✨ Admin delete account endpoint
This commit is contained in:
@@ -315,4 +315,15 @@ public class AccountController(
|
|||||||
await socialCreditService.ValidateSocialCredits();
|
await socialCreditService.ValidateSocialCredits();
|
||||||
return Ok();
|
return Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpDelete("{name}")]
|
||||||
|
[Authorize]
|
||||||
|
[RequiredPermission("maintenance", "accounts.deletion")]
|
||||||
|
public async Task<IActionResult> AdminDeleteAccount(string name)
|
||||||
|
{
|
||||||
|
var account = await accounts.LookupAccount(name);
|
||||||
|
if (account is null) return NotFound();
|
||||||
|
await accounts.DeleteAccount(account);
|
||||||
|
return Ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user