[ACS-7689] Save holds methods

This commit is contained in:
Tomasz Nastaly
2024-06-10 12:01:35 +02:00
parent 907a607a96
commit 728081b1bd
2 changed files with 39 additions and 0 deletions

View File

@@ -53,4 +53,25 @@ export class LegalHoldService {
catchError((err) => throwError(err))
);
}
/**
* Adds to hold to existing hold
*
* @param ids The list of manage hold Ids
* @param ids list of ids of holds to add to existing hold
* @returns List of assigned holds Hold[]
*/
saveHold(ids: string[], holdId: string): Observable<Hold[]> {
return from(this.legalHoldApi.saveToExistingHolds(ids, holdId)).pipe(
map(({ list }) =>
list?.entries?.map(({ entry }) => ({
id: entry?.id,
name: entry?.name,
reason: entry?.reason,
description: entry?.description
}))
),
catchError((err) => throwError(err))
);
}
}

View File

@@ -51,4 +51,22 @@ export class LegalHoldApi extends BaseApi {
returnType: NodeChildAssociationPaging
});
}
/**
* Adds to existiing hold
*
* @param holdId The identifier of a hold.
* @param ids list of ids of holds to add to existing hold
* @returns Promise<NodeChildAssociationPaging>
*/
saveToExistingHolds(ids: string[], holdId: string): Promise<NodeChildAssociationPaging> {
throwIfNotDefined(holdId, 'holdId');
return this.post({
path: '/holds/{holdId}/children',
pathParams: { holdId },
bodyParam: ids,
returnType: NodeChildAssociationPaging
});
}
}