mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 02:26:55 -07:00
* Fixed not being able to remove legacy mobile users #3968
This commit is contained in:
parent
b4b80165b9
commit
0936354df5
3 changed files with 19 additions and 3 deletions
12
src/Ombi/.vscode/launch.json
vendored
12
src/Ombi/.vscode/launch.json
vendored
|
@ -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",
|
||||
|
|
|
@ -17,6 +17,6 @@ export class MobileService extends ServiceHelpers {
|
|||
}
|
||||
|
||||
public deleteUser(userId: string): Observable<boolean> {
|
||||
return this.http.post<boolean>(`${this.url}remove/`, userId, {headers: this.headers});
|
||||
return this.http.post<boolean>(`${this.url}`, { userId: userId }, {headers: this.headers});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<bool> RemoveUser([FromBody] string userId)
|
||||
public async Task<bool> 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue