export enum CommonResourceServiceError {
UNIQUE_VIOLATION = 'UniqueViolation',
+ OWNERSHIP_CYCLE = 'OwnershipCycle',
UNKNOWN = 'Unknown',
NONE = 'None'
}
}));
}
- update(uuid: string, data: any) {
+ update(uuid: string, data: Partial<T>) {
return CommonResourceService.defaultResponse(
this.serverApi
- .put<T>(this.resourceType + uuid, data));
+ .put<T>(this.resourceType + uuid, data && CommonResourceService.mapKeys(_.snakeCase)(data)));
}
}
switch (true) {
case /UniqueViolation/.test(error):
return CommonResourceServiceError.UNIQUE_VIOLATION;
+ case /Owner uuid has an ownership cycle/.test(error):
+ return CommonResourceServiceError.OWNERSHIP_CYCLE;
default:
return CommonResourceServiceError.UNKNOWN;
}