feat: allow admins to delete users

This commit is contained in:
Sheen Capadngan
2024-07-08 15:04:08 +08:00
parent 5eba61b647
commit 6e15979672
8 changed files with 247 additions and 6 deletions
+8 -3
View File
@@ -201,7 +201,7 @@ export const userServiceFactory = ({
return user;
};
const deleteMe = async (userId: string) => {
const deleteUser = async (userId: string) => {
const user = await userDAL.deleteById(userId);
return user;
};
@@ -295,19 +295,24 @@ export const userServiceFactory = ({
return updatedOrgMembership.projectFavorites;
};
const listUsers = async () => {
return userDAL.find({});
};
return {
sendEmailVerificationCode,
verifyEmailVerificationCode,
toggleUserMfa,
updateUserName,
updateAuthMethods,
deleteMe,
deleteUser,
getMe,
createUserAction,
getUserAction,
unlockUser,
getUserPrivateKey,
getUserProjectFavorites,
updateUserProjectFavorites
updateUserProjectFavorites,
listUsers
};
};