ACS-8055 clean up code

This commit is contained in:
DaryaBalvanovich
2024-06-06 09:50:33 +02:00
parent 0bdcc38367
commit 907a607a96
4 changed files with 15 additions and 14 deletions

View File

@@ -248,16 +248,14 @@ export class NodesApiService {
*/ */
getNodeAssignHolds(nodeId: string): Observable<Hold[]> { getNodeAssignHolds(nodeId: string): Observable<Hold[]> {
const queryOptions = Object.assign({ const queryOptions = Object.assign({
maxItems: this.preferences.paginationSize,
skipCount: 0,
where: `(assocType='rma:frozenContent')` where: `(assocType='rma:frozenContent')`
}); });
return from(this.nodesApi.listParents(nodeId, queryOptions)).pipe( return from(this.nodesApi.listParents(nodeId, queryOptions)).pipe(
map((holds) => map(({ list }) =>
holds.list?.entries?.map((entity) => ({ list?.entries?.map(({ entry }) => ({
id: entity.entry.id, id: entry?.id,
name: entity.entry.name name: entry?.name
})) }))
), ),
catchError((err) => throwError(err)) catchError((err) => throwError(err))

View File

@@ -31,6 +31,7 @@ describe('LegalHoldsService', () => {
imports: [ContentTestingModule] imports: [ContentTestingModule]
}); });
service = TestBed.inject(LegalHoldService); service = TestBed.inject(LegalHoldService);
legalHolds = { legalHolds = {
list: { list: {
entries: [ entries: [
@@ -44,6 +45,7 @@ describe('LegalHoldsService', () => {
] ]
} }
} as NodeChildAssociationPaging; } as NodeChildAssociationPaging;
returnedHolds = [ returnedHolds = [
{ {
id: mockId, id: mockId,

View File

@@ -13,9 +13,10 @@ export interface Hold {
``` ```
## Properties ## Properties
Name | Type | Default value | Description Name | Type | Default value | Description
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**id** | **string** | | hold id **id** | **string** | | Hold id
**name** | **string** | | hold name **name** | **string** | | Hold name
**reason** | **string** | | hold reason **reason** | **string** | | Hold reason
**description** | **string** | | [optional] [additional information for a hold] **description** | **string** | | [optional] [Additional information for a hold]

View File

@@ -39,11 +39,11 @@ legalHoldApi.getHolds('-filePlan-', opts).then((data) => {
### Parameters ### Parameters
Name | Type | Description | Notes Name | Type | Default value | Description
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**filePlanId** | **string** | The site details | **filePlanId** | **string** | | The site details
**skipCount** | **number**| The number of entities that exist in the collection before those included in this list. | [optional] **skipCount** | **number**| `0` | The number of entities that exist in the collection before those included in this list. [optional]
**maxItems** | **number**| The maximum number of items to return in the list. | [optional] **maxItems** | **number**| `100` | The maximum number of items to return in the list. [optional]
### Return type ### Return type