From cf4ce587c4c59fa10903e465c7fa2a8078f61ad0 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 15 Jan 2025 10:24:28 +0100 Subject: [PATCH] Cleanups --- packages/frontend-core/src/fetch/DataFetch.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/frontend-core/src/fetch/DataFetch.ts b/packages/frontend-core/src/fetch/DataFetch.ts index 14d10db099..62e6c2423d 100644 --- a/packages/frontend-core/src/fetch/DataFetch.ts +++ b/packages/frontend-core/src/fetch/DataFetch.ts @@ -44,17 +44,14 @@ interface DataFetchDerivedStore supportsPagination: boolean } -export interface DataFetchParams< - TDatasource, - TQuery = SearchFilters | undefined -> { +export interface DataFetchParams { API: APIClient datasource: TDatasource query: TQuery options?: Partial> } -export interface DataFetchOptions { +export interface DataFetchOptions { // Search config filter: UISearchFilter | LegacyFilter[] | null query: TQuery @@ -272,6 +269,7 @@ export default abstract class BaseDataFetch< // Build the query let query = this.options.query + if (!query) { query = buildQuery(filter ?? undefined) as TQuery } @@ -435,7 +433,7 @@ export default abstract class BaseDataFetch< * Resets the data set and updates options * @param newOptions any new options */ - async update(newOptions: Partial>) { + async update(newOptions: Partial>) { // Check if any settings have actually changed let refresh = false for (const [key, value] of Object.entries(newOptions || {})) {