🚧 back: user deletion wip

This commit is contained in:
Eric Doughty-Papassideris
2025-03-04 17:50:29 +01:00
committed by Anton Shepilov
parent 99d78ad5ac
commit 658e8de6d4
4 changed files with 110 additions and 66 deletions
@@ -158,6 +158,7 @@ export class UserServiceImpl {
const user = await this.get(pk);
if (context.user.server_request || context.user.id === user.id) {
const userCopy = { ...user } as User;
//We keep a part of the user id as new name
const partialId = user.id.toString().split("-")[0];
@@ -177,6 +178,8 @@ export class UserServiceImpl {
localEventBus.publish<ResourceEventsPayload>("user:deleted", {
user: user,
});
await gr.platformServices.admin.deleteUser(userCopy);
}
}