feat: bulk user to admin mutation added

This commit is contained in:
mirarifhasan
2024-01-29 19:19:52 +06:00
committed by Andrew Bastin
parent 2a667a74f0
commit da606f5a96
3 changed files with 46 additions and 0 deletions

View File

@@ -429,6 +429,17 @@ export class AdminService {
return E.right(true);
}
/**
* Make users to admin
* @param userUid User UIDs
* @returns an Either of boolean or error
*/
async makeUsersAdmin(userUIDs: string[]) {
const isUpdated = await this.userService.makeAdmins(userUIDs);
if (E.isLeft(isUpdated)) return E.left(isUpdated.left);
return E.right(true);
}
/**
* Remove user as admin
* @param userUid User UID