mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-13 02:32:15 +01:00
upgrade inertia v2; add prefetching; migrate queries to tanstack query
vue
This commit is contained in:
@@ -1,26 +1,9 @@
|
||||
import { useProjectsStore } from '@/utils/useProjects';
|
||||
import { useTasksStore } from '@/utils/useTasks';
|
||||
import { useTagsStore } from '@/utils/useTags';
|
||||
import { useCurrentTimeEntryStore } from '@/utils/useCurrentTimeEntry';
|
||||
import { useClientsStore } from '@/utils/useClients';
|
||||
import { useMembersStore } from '@/utils/useMembers';
|
||||
import { useTimeEntriesStore } from '@/utils/useTimeEntries';
|
||||
import { canViewClients, canViewMembers } from '@/utils/permissions';
|
||||
|
||||
export function initializeStores() {
|
||||
refreshStores();
|
||||
}
|
||||
|
||||
export function refreshStores() {
|
||||
useProjectsStore().fetchProjects();
|
||||
useTasksStore().fetchTasks();
|
||||
useTagsStore().fetchTags();
|
||||
// TanStack Query now handles projects, tasks, tags, clients, and members fetching automatically
|
||||
// Only initialize stores that aren't migrated to TanStack Query yet
|
||||
useCurrentTimeEntryStore().fetchCurrentTimeEntry();
|
||||
useTimeEntriesStore().patchTimeEntries();
|
||||
if (canViewMembers()) {
|
||||
useMembersStore().fetchMembers();
|
||||
}
|
||||
if (canViewClients()) {
|
||||
useClientsStore().fetchClients();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user