diff --git a/src/hooks/tableData/useTableData.ts b/src/hooks/tableData/useTableData.ts index 25aa35c..56ea896 100644 --- a/src/hooks/tableData/useTableData.ts +++ b/src/hooks/tableData/useTableData.ts @@ -85,7 +85,7 @@ export function useTableData() { const registrationResults: RegistrationQueryResults = await engine.query(EVENT_QUERY({ ouMode: undefined as unknown as string, program: getDataStoreData?.program as unknown as string, - order: "createdAt:desc", + order: getDataStoreData?.defaults?.defaultOrder || "createdAt:desc", programStage: getDataStoreData?.registration?.programStage as unknown as string, orgUnit: tei.orgUnit, trackedEntity: tei.trackedEntity diff --git a/src/types/dataStore/DataStoreConfig.ts b/src/types/dataStore/DataStoreConfig.ts index f64a927..1a0700d 100644 --- a/src/types/dataStore/DataStoreConfig.ts +++ b/src/types/dataStore/DataStoreConfig.ts @@ -31,6 +31,7 @@ interface transfer { interface defaults { currentAcademicYear: string + defaultOrder: string } interface filterItem {