diff --git a/api-gateway/src/api/service/schema.ts b/api-gateway/src/api/service/schema.ts index a002f47a03..83da9d8d39 100644 --- a/api-gateway/src/api/service/schema.ts +++ b/api-gateway/src/api/service/schema.ts @@ -417,6 +417,14 @@ export class SchemaApi { required: false, example: 'text' }) + @ApiQuery({ + name: 'searchOptions', + type: String, + description: 'Search Options', + required: false, + isArray: true, + example: 'name' + }) @ApiOkResponse({ description: 'Successful operation.', isArray: true, @@ -440,6 +448,7 @@ export class SchemaApi { @Query('toolId') toolId: string, @Query('topicId') topicId: string, @Query('search') search: string, + @Query('searchOptions') searchOptions: string[] | string, @Response() res: any ): Promise { try { @@ -468,6 +477,13 @@ export class SchemaApi { if (search) { options.search = search; } + if (searchOptions) { + if (Array.isArray(searchOptions)) { + options.searchOptions = searchOptions; + } else if (typeof searchOptions === 'string') { + options.searchOptions = searchOptions.split(','); + } + } options.fields = Object.values(SCHEMA_REQUIRED_PROPS) const { items, count } = await guardians.getSchemasByOwnerV2(options, owner); diff --git a/frontend/src/app/services/schema.service.ts b/frontend/src/app/services/schema.service.ts index 8571ba7ebb..dc60ec49a8 100644 --- a/frontend/src/app/services/schema.service.ts +++ b/frontend/src/app/services/schema.service.ts @@ -104,6 +104,7 @@ export class SchemaService { category?: SchemaCategory, topicId?: string, search?: string, + searchOptions?: string[], pageIndex?: number, pageSize?: number | string, }): Observable> { diff --git a/frontend/src/app/views/schemas/schemas.component.html b/frontend/src/app/views/schemas/schemas.component.html index ac7aee6891..4265e824fc 100644 --- a/frontend/src/app/views/schemas/schemas.component.html +++ b/frontend/src/app/views/schemas/schemas.component.html @@ -63,6 +63,19 @@