Clear username links in the same transaction when clearing username hashes

This commit is contained in:
Jon Chambers
2023-10-18 12:49:32 -04:00
committed by Jon Chambers
parent ac0c8b1e9a
commit 6441d5838d
3 changed files with 14 additions and 3 deletions

View File

@@ -274,7 +274,6 @@ public class AccountController {
@ApiResponse(responseCode = "204", description = "Username successfully deleted.", useReturnTypeSchema = true)
@ApiResponse(responseCode = "401", description = "Account authentication check failed.")
public CompletableFuture<Void> deleteUsernameHash(@Auth final AuthenticatedAccount auth) {
clearUsernameLink(auth.getAccount());
return accounts.clearUsernameHash(auth.getAccount())
.thenRun(Util.NOOP);
}