handle null plate id in case we delete it from ui
MODIFY
src/server/rest/v1/service/UserService.ts
src/server/rest/v1/service/UserService.ts
@@ -539,11 +539,9 @@ export default class UserService {
await UserStorage.saveUserRole(req.user.tenantID, user.id, filteredRequest.role);
}
// Save Admin Data
- if (filteredRequest.plateID) {
+ if (Utils.objectHasProperty(filteredRequest, 'plateID')) {
const adminData: { plateID?: string; } = {};
- if (filteredRequest.plateID) {
- adminData.plateID = filteredRequest.plateID;
- }
+ adminData.plateID = filteredRequest.plateID || null;
await UserStorage.saveUserAdminData(req.user.tenantID, user.id, adminData);
}
}

handle null plate id in case we delete it from ui