-interface GroupsResponse {
- offset: number;
- limit: number;
- items: Array<{
- href: string;
- kind: string;
- etag: string;
- uuid: string;
- owner_uuid: string;
- created_at: string;
- modified_by_client_uuid: string;
- modified_by_user_uuid: string;
- modified_at: string;
- name: string;
- group_class: string;
- description: string;
- writable_by: string[];
- delete_at: string;
- trash_at: string;
- is_trashed: boolean;
- }>;
-}
+ create(data: Partial<ProjectResource>) {
+ const projectData = { ...data, groupClass: GroupClass.PROJECT };
+ return super.create(projectData);
+ }
+
+ update(uuid: string, data: Partial<ProjectResource>) {
+ if (uuid && data && data.properties) {
+ const { properties } = data;
+ const mappedData = {
+ ...TrashableResourceService.mapKeys(snakeCase)(data),
+ properties,
+ };
+ return TrashableResourceService
+ .defaultResponse(
+ this.serverApi
+ .put<ProjectResource>(this.resourceType + uuid, mappedData),
+ this.actions,
+ false
+ );
+ }
+ return TrashableResourceService
+ .defaultResponse(
+ this.serverApi
+ .put<ProjectResource>(this.resourceType + uuid, data && TrashableResourceService.mapKeys(snakeCase)(data)),
+ this.actions
+ );
+ }