mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-10 14:11:42 +00:00
[ACS-7689] Save holds methods
This commit is contained in:
@@ -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))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -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
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user