1
0
Fork 0
mirror of synced 2024-07-13 02:05:54 +12:00

Adding countRows to search validators.

This commit is contained in:
mike12345567 2024-06-18 11:16:21 +01:00
parent 75bf3c78e6
commit 73013332ae
4 changed files with 5 additions and 2 deletions

View file

@ -60,7 +60,7 @@ export async function searchView(
user: sdk.users.getUserContextBindings(ctx.user),
})
const searchOptions: RequiredKeys<Omit<SearchViewRowRequest, "countRows">> &
const searchOptions: RequiredKeys<SearchViewRowRequest> &
RequiredKeys<Pick<RowSearchParams, "tableId" | "query" | "fields">> = {
tableId: view.tableId,
query: enrichedQuery,
@ -69,6 +69,7 @@ export async function searchView(
limit: body.limit,
bookmark: body.bookmark,
paginate: body.paginate,
countRows: body.countRows,
}
const result = await sdk.rows.search(searchOptions)

View file

@ -86,6 +86,7 @@ router
router.post(
"/api/v2/views/:viewId/search",
internalSearchValidator(),
authorizedResource(PermissionType.VIEW, PermissionLevel.READ, "viewId"),
rowController.views.searchView
)

View file

@ -109,6 +109,7 @@ export function internalSearchValidator() {
sortOrder: OPTIONAL_STRING,
sortType: OPTIONAL_STRING,
paginate: Joi.boolean(),
countRows: Joi.boolean(),
bookmark: Joi.alternatives()
.try(OPTIONAL_STRING, OPTIONAL_NUMBER)
.optional(),

View file

@ -21102,7 +21102,7 @@ tar@6.1.15:
mkdirp "^1.0.3"
yallist "^4.0.0"
tar@^6.1.11, tar@^6.1.2:
tar@6.2.1, tar@^6.1.11, tar@^6.1.2:
version "6.2.1"
resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a"
integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==