From e4fbe0545510a007d200dc07dede2a4294573381 Mon Sep 17 00:00:00 2001 From: Nikolay Marchuk Date: Fri, 25 Apr 2025 23:05:30 +0700 Subject: [PATCH] Support fulltext search api in REST api-client (#8712) * Support fulltext search api in REST api-client Signed-off-by: Nikolay Marchuk * Fix template string formatting Signed-off-by: Nikolay Marchuk --------- Signed-off-by: Nikolay Marchuk --- packages/api-client/src/rest/rest.ts | 2 +- packages/api-client/src/rest/types.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/api-client/src/rest/rest.ts b/packages/api-client/src/rest/rest.ts index 25be15d7f5..ccf1a95c16 100644 --- a/packages/api-client/src/rest/rest.ts +++ b/packages/api-client/src/rest/rest.ts @@ -229,7 +229,7 @@ export class RestClientImpl implements RestClient { if (options.limit != null) { params.append('limit', `${options.limit}`) } - const requestUrl = concatLink(this.endpoint, `/api/v1/search-fulltext/${this.workspace}`) + const requestUrl = concatLink(this.endpoint, `/api/v1/search-fulltext/${this.workspace}?${params.toString()}`) const response = await fetch(requestUrl, { method: 'GET', headers: this.jsonHeaders(), diff --git a/packages/api-client/src/rest/types.ts b/packages/api-client/src/rest/types.ts index e8fe2c1114..cb3efaf950 100644 --- a/packages/api-client/src/rest/types.ts +++ b/packages/api-client/src/rest/types.ts @@ -22,6 +22,7 @@ import { type Doc, type DocumentQuery, type FindOptions, + type FulltextStorage, type Hierarchy, type ModelDb, type Ref, @@ -29,7 +30,7 @@ import { type WithLookup } from '@hcengineering/core' -export interface RestClient extends Storage { +export interface RestClient extends Storage, FulltextStorage { getAccount: () => Promise findOne: (