task-d.7.9
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { queryOptions } from '@tanstack/react-query';
|
||||
import {
|
||||
getCurrentSetupRun,
|
||||
getSetupProfiles,
|
||||
getSetupReadiness,
|
||||
getSetupRunReport,
|
||||
getSetupTemplates,
|
||||
@@ -10,24 +11,31 @@ import type { SetupVerificationPayload } from './types';
|
||||
|
||||
export const setupKeys = {
|
||||
all: ['setup'] as const,
|
||||
readiness: () => [...setupKeys.all, 'readiness'] as const,
|
||||
templates: () => [...setupKeys.all, 'templates'] as const,
|
||||
readiness: (profileId?: string) => [...setupKeys.all, 'readiness', profileId ?? 'crm_demo'] as const,
|
||||
templates: (profileId?: string) => [...setupKeys.all, 'templates', profileId ?? 'crm_demo'] as const,
|
||||
profiles: (profileId?: string) => [...setupKeys.all, 'profiles', profileId ?? 'crm_demo'] as const,
|
||||
run: () => [...setupKeys.all, 'run'] as const,
|
||||
report: () => [...setupKeys.all, 'run', 'report'] as const,
|
||||
verification: (payload: SetupVerificationPayload = {}) =>
|
||||
[...setupKeys.all, 'verification', payload] as const
|
||||
};
|
||||
|
||||
export const setupReadinessQueryOptions = () =>
|
||||
export const setupReadinessQueryOptions = (profileId?: string) =>
|
||||
queryOptions({
|
||||
queryKey: setupKeys.readiness(),
|
||||
queryFn: () => getSetupReadiness()
|
||||
queryKey: setupKeys.readiness(profileId),
|
||||
queryFn: () => getSetupReadiness(profileId)
|
||||
});
|
||||
|
||||
export const setupTemplatesQueryOptions = () =>
|
||||
export const setupTemplatesQueryOptions = (profileId?: string) =>
|
||||
queryOptions({
|
||||
queryKey: setupKeys.templates(),
|
||||
queryFn: () => getSetupTemplates()
|
||||
queryKey: setupKeys.templates(profileId),
|
||||
queryFn: () => getSetupTemplates(profileId)
|
||||
});
|
||||
|
||||
export const setupProfilesQueryOptions = (profileId?: string) =>
|
||||
queryOptions({
|
||||
queryKey: setupKeys.profiles(profileId),
|
||||
queryFn: () => getSetupProfiles(profileId)
|
||||
});
|
||||
|
||||
export const setupRunQueryOptions = () =>
|
||||
|
||||
Reference in New Issue
Block a user