diff --git a/src/Ombi/.vscode/launch.json b/src/Ombi/.vscode/launch.json index b14ee6004..642e584c5 100644 --- a/src/Ombi/.vscode/launch.json +++ b/src/Ombi/.vscode/launch.json @@ -12,6 +12,18 @@ "stopAtEntry": false, "console": "internalConsole" }, + { + "name": "Launch Frontend", + "type": "pwa-node", + "request": "launch", + "runtimeExecutable": "yarn", + "cwd": "${workspaceFolder}/ClientApp", + "runtimeArgs": ["start"], + "resolveSourceMapLocations": [ + "${workspaceFolder}/**", + "!**/node_modules/**" + ], + }, { "name": "ng serve", "type": "chrome", diff --git a/src/Ombi/ClientApp/src/app/services/mobile.service.ts b/src/Ombi/ClientApp/src/app/services/mobile.service.ts index 177f1f35f..9a471ee47 100644 --- a/src/Ombi/ClientApp/src/app/services/mobile.service.ts +++ b/src/Ombi/ClientApp/src/app/services/mobile.service.ts @@ -17,6 +17,6 @@ export class MobileService extends ServiceHelpers { } public deleteUser(userId: string): Observable { - return this.http.post(`${this.url}remove/`, userId, {headers: this.headers}); + return this.http.post(`${this.url}`, { userId: userId }, {headers: this.headers}); } } diff --git a/src/Ombi/Controllers/V1/MobileController.cs b/src/Ombi/Controllers/V1/MobileController.cs index 2bae31c9d..2ca640769 100644 --- a/src/Ombi/Controllers/V1/MobileController.cs +++ b/src/Ombi/Controllers/V1/MobileController.cs @@ -83,12 +83,16 @@ namespace Ombi.Controllers.V1 return vm; } + public class RemoveUserModel + { + public string UserId { get; set; } + } [HttpPost] [ApiExplorerSettings(IgnoreApi = true)] [Admin] - public async Task RemoveUser([FromBody] string userId) + public async Task RemoveUser([FromBody] RemoveUserModel userId) { - var user = await _userManager.Users.Include(x => x.NotificationUserIds).FirstOrDefaultAsync(x => x.Id.Equals(userId, StringComparison.InvariantCultureIgnoreCase)); + var user = await _userManager.Users.Include(x => x.NotificationUserIds).FirstOrDefaultAsync(x => x.Id.Equals(userId.UserId, StringComparison.InvariantCultureIgnoreCase)); try { await _notification.DeleteRange(user.NotificationUserIds);