🐛 Accept username in request of API delete user
This commit is contained in:
committed by
Anton Shepilov
parent
1f975f1ed5
commit
bebf337d28
@@ -149,9 +149,12 @@ export type UserNotificationPreferences = {
|
||||
};
|
||||
};
|
||||
|
||||
export type UserPrimaryKey = Pick<User, "id">;
|
||||
export type UserPrimaryKey = {
|
||||
id?: uuid;
|
||||
username_canonical?: string;
|
||||
};
|
||||
|
||||
export function getInstance(user: Partial<User>): User {
|
||||
user.creation_date = !isNumber(user.creation_date) ? Date.now() : user.creation_date;
|
||||
user.creation_date = !isNumber(user?.creation_date) ? Date.now() : user?.creation_date;
|
||||
return merge(new User(), user);
|
||||
}
|
||||
|
||||
@@ -185,7 +185,10 @@ export class UserServiceImpl {
|
||||
user: user,
|
||||
});
|
||||
|
||||
return deleteData && (await gr.platformServices.admin.deleteUser(userCopy));
|
||||
return {
|
||||
isDeleted: deleteData && (await gr.platformServices.admin.deleteUser(userCopy)),
|
||||
userId: user.id,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user