mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 07:37:11 +01:00
Fix isAdmin check. Fix Schema.
This commit is contained in:
parent
371425ab60
commit
d60ad1c782
4 changed files with 18 additions and 18 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue