From 9d4049beb1822e13e13cbb68e4113427e13ec10c Mon Sep 17 00:00:00 2001 From: vaidas-dutrys <139754995+vaidas-dutrys@users.noreply.github.com> Date: Fri, 16 Feb 2024 10:51:09 +0200 Subject: [PATCH] fix: updated searchBy definition to array instead of string (#870) --- src/swagger/api-paginated-query.decorator.ts | 1 + src/swagger/pagination-docs.spec.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/swagger/api-paginated-query.decorator.ts b/src/swagger/api-paginated-query.decorator.ts index 6f13996..094b7cc 100644 --- a/src/swagger/api-paginated-query.decorator.ts +++ b/src/swagger/api-paginated-query.decorator.ts @@ -144,6 +144,7 @@ function SearchBy(paginateConfig: PaginateConfig) { ${li('Available Fields', paginateConfig.searchableColumns)} `, required: false, + isArray: true, type: 'string', }) } diff --git a/src/swagger/pagination-docs.spec.ts b/src/swagger/pagination-docs.spec.ts index 3345a8b..646be6a 100644 --- a/src/swagger/pagination-docs.spec.ts +++ b/src/swagger/pagination-docs.spec.ts @@ -226,7 +226,10 @@ describe('PaginatedEndpoint decorator', () => { description: 'List of fields to search by term to filter result values\n

\n Example: name\n

\n

\n Default Value: By default all fields mentioned below will be used to search by term\n

\n

Available Fields

\n ', schema: { - type: 'string', + type: 'array', + items: { + type: 'string', + }, }, }, {