File tree Expand file tree Collapse file tree 4 files changed +22
-8
lines changed
Expand file tree Collapse file tree 4 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ export interface ICollectionsRepository {
2525 collectionId ?: string ,
2626 limit ?: number ,
2727 offset ?: number ,
28- collectionSearchCriteria ?: CollectionSearchCriteria
28+ collectionSearchCriteria ?: CollectionSearchCriteria ,
29+ searchServiceName ?: string
2930 ) : Promise < CollectionItemSubset >
3031 getMyDataCollectionItems (
3132 roleIds : number [ ] ,
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export class GetCollectionItems implements UseCase<CollectionItemSubset> {
1010 this . collectionsRepository = collectionsRepository
1111 }
1212
13- /**
13+ /** TODO: document searchServiceName
1414 * Returns an instance of CollectionItemSubset that contains reduced information for each item that the calling user can access in the installation.
1515 * If the collectionId parameter is not set, the use case will return items starting from the root collection.
1616 *
@@ -24,13 +24,15 @@ export class GetCollectionItems implements UseCase<CollectionItemSubset> {
2424 collectionId ?: string ,
2525 limit ?: number ,
2626 offset ?: number ,
27- collectionSearchCriteria ?: CollectionSearchCriteria
27+ collectionSearchCriteria ?: CollectionSearchCriteria ,
28+ searchServiceName ?: string
2829 ) : Promise < CollectionItemSubset > {
2930 return await this . collectionsRepository . getCollectionItems (
3031 collectionId ,
3132 limit ,
3233 offset ,
33- collectionSearchCriteria
34+ collectionSearchCriteria ,
35+ searchServiceName
3436 )
3537 }
3638}
Original file line number Diff line number Diff line change @@ -63,7 +63,8 @@ export enum GetCollectionItemsQueryParams {
6363 START = 'start' ,
6464 TYPE = 'type' ,
6565 FILTERQUERY = 'fq' ,
66- SHOW_TYPE_COUNTS = 'show_type_counts'
66+ SHOW_TYPE_COUNTS = 'show_type_counts' ,
67+ SEARCH_SERVICE_NAME = 'search_service'
6768}
6869
6970export enum GetMyDataCollectionItemsQueryParams {
@@ -155,7 +156,8 @@ export class CollectionsRepository extends ApiRepository implements ICollections
155156 collectionId ?: string ,
156157 limit ?: number ,
157158 offset ?: number ,
158- collectionSearchCriteria ?: CollectionSearchCriteria
159+ collectionSearchCriteria ?: CollectionSearchCriteria ,
160+ searchServiceName ?: string
159161 ) : Promise < CollectionItemSubset > {
160162 const queryParams = new URLSearchParams ( {
161163 [ GetCollectionItemsQueryParams . QUERY ] : '*' ,
@@ -177,6 +179,10 @@ export class CollectionsRepository extends ApiRepository implements ICollections
177179 queryParams . set ( GetCollectionItemsQueryParams . START , offset . toString ( ) )
178180 }
179181
182+ if ( searchServiceName ) {
183+ queryParams . set ( GetCollectionItemsQueryParams . SEARCH_SERVICE_NAME , searchServiceName )
184+ }
185+
180186 if ( collectionSearchCriteria ) {
181187 this . applyCollectionSearchCriteriaToQueryParams ( queryParams , collectionSearchCriteria )
182188 }
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ describe('execute', () => {
6060 collectionId ,
6161 undefined ,
6262 undefined ,
63+ undefined ,
6364 undefined
6465 )
6566 expect ( actual ) . toEqual ( testItemSubset )
@@ -75,6 +76,7 @@ describe('execute', () => {
7576 undefined ,
7677 limit ,
7778 undefined ,
79+ undefined ,
7880 undefined
7981 )
8082 expect ( actual ) . toEqual ( testItemSubset )
@@ -90,6 +92,7 @@ describe('execute', () => {
9092 undefined ,
9193 undefined ,
9294 offset ,
95+ undefined ,
9396 undefined
9497 )
9598 expect ( actual ) . toEqual ( testItemSubset )
@@ -112,7 +115,8 @@ describe('execute', () => {
112115 undefined ,
113116 undefined ,
114117 undefined ,
115- searchCriteria
118+ searchCriteria ,
119+ undefined
116120 )
117121 expect ( actual ) . toEqual ( testItemSubset )
118122 } )
@@ -133,7 +137,8 @@ describe('execute', () => {
133137 collectionId ,
134138 limit ,
135139 offset ,
136- searchCriteria
140+ searchCriteria ,
141+ undefined
137142 )
138143 expect ( actual ) . toEqual ( testItemSubset )
139144 } )
You can’t perform that action at this time.
0 commit comments