Fix isAdmin check. Fix Schema.

This commit is contained in:
Brian Cao 2022-11-21 16:44:42 -08:00
parent 371425ab60
commit d60ad1c782
4 changed files with 18 additions and 18 deletions

View file

@ -42,7 +42,6 @@ export default async (
if (req.method === 'POST') {
const { roleId, teamId } = req.body;
// Check when userRolename changes
const userRole = getUserRole({ userId: id, roleId, teamId });
if (userRole) {
@ -57,13 +56,6 @@ export default async (
if (req.method === 'DELETE') {
const { userRoleId } = req.body;
// Check when userRolename changes
const userRole = getUserRole({ id: userRoleId });
if (userRole) {
return badRequest(res, 'Role already exists for User.');
}
const updated = await deleteUserRole(userRoleId);
return ok(res, updated);