mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-12 10:12:17 +01:00
add pagination to client and project table
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useQuery } from '@tanstack/vue-query';
|
||||
import { useQuery, keepPreviousData } from '@tanstack/vue-query';
|
||||
import { api, type TimeEntryResponse } from '@/packages/api/src';
|
||||
import { getCurrentOrganizationId } from '@/utils/useUser';
|
||||
import { computed, type Ref, type ComputedRef, unref } from 'vue';
|
||||
@@ -21,6 +21,9 @@ export function useTimeEntriesReportQuery(
|
||||
},
|
||||
queries: { ...unref(filterParams) },
|
||||
}),
|
||||
// Keep the previous page's data (incl. meta.total) while the next page loads, so
|
||||
// pagination doesn't transiently see total=1 and clamp the page back to 1.
|
||||
placeholderData: keepPreviousData,
|
||||
staleTime: 1000 * 30, // 30 seconds
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user