From fcb36319392767ffe140a346c9676624449524da Mon Sep 17 00:00:00 2001 From: Yazeed Loonat Date: Thu, 7 Mar 2024 16:31:21 -0700 Subject: [PATCH] fix: user update/create fixes (#3932) --- api/src/services/user.service.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/api/src/services/user.service.ts b/api/src/services/user.service.ts index 599824a520..69bcb05bdc 100644 --- a/api/src/services/user.service.ts +++ b/api/src/services/user.service.ts @@ -197,6 +197,7 @@ export class UserService { // only update userRoles if something has changed if (dto.userRoles && storedUser.userRoles) { if ( + requestingUser.userRoles.isAdmin && !( dto.userRoles.isAdmin === storedUser.userRoles.isAdmin && dto.userRoles.isJurisdictionalAdmin === @@ -551,11 +552,6 @@ export class UserService { listings: { connect: listings.map((listing) => ({ id: listing.id })), }, - userRoles: { - create: { - ...dto.userRoles, - }, - }, }, where: { id: existingUser.id,