From a41f0292a034d56b8dd7d0ea1ecf31f425042dd2 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 30 Dec 2024 22:47:41 +0100 Subject: [PATCH] Update promises --- .../src/components/grid/stores/datasources/nonPlus.ts | 4 ++-- packages/frontend-core/src/components/grid/stores/rows.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/frontend-core/src/components/grid/stores/datasources/nonPlus.ts b/packages/frontend-core/src/components/grid/stores/datasources/nonPlus.ts index 17e5e8b8d9..15bbc9b396 100644 --- a/packages/frontend-core/src/components/grid/stores/datasources/nonPlus.ts +++ b/packages/frontend-core/src/components/grid/stores/datasources/nonPlus.ts @@ -106,7 +106,7 @@ export const initialise = (context: StoreContext) => { if (!isSameDatasource($fetch?.options?.datasource, $datasource)) { return } - $fetch.update({ + $fetch?.update({ filter: $allFilters, }) }) @@ -120,7 +120,7 @@ export const initialise = (context: StoreContext) => { if (!isSameDatasource($fetch?.options?.datasource, $datasource)) { return } - $fetch.update({ + $fetch?.update({ sortOrder: $sort.order || SortOrder.ASCENDING, sortColumn: $sort.column, }) diff --git a/packages/frontend-core/src/components/grid/stores/rows.ts b/packages/frontend-core/src/components/grid/stores/rows.ts index 4eb3cd9380..d6b80df885 100644 --- a/packages/frontend-core/src/components/grid/stores/rows.ts +++ b/packages/frontend-core/src/components/grid/stores/rows.ts @@ -65,7 +65,7 @@ interface RowActionStore { loadNextPage: () => void refreshRow: (id: string) => Promise replaceRow: (id: string, row: UIRow | undefined) => void - refreshData: () => void + refreshData: () => Promise cleanRow: (row: UIRow) => Row bulkUpdate: ( changeMap: Record>, @@ -514,8 +514,8 @@ export const createActions = (context: StoreContext): RowActionStore => { } // Refreshes all data - const refreshData = () => { - get(fetch)?.getInitialData() + const refreshData = async () => { + await get(fetch)?.getInitialData() } // Checks if a changeset for a row actually mutates the row or not