feat: routers client and version prefixes
This commit is contained in:
@ -801,276 +801,6 @@ export const getBuiltInModulesOptions = (
|
||||
});
|
||||
};
|
||||
|
||||
export const getProjectsQueryKey = (options?: Options<GetProjectsData>) =>
|
||||
createQueryKey("getProjects", options);
|
||||
|
||||
/**
|
||||
* Get Projects
|
||||
*/
|
||||
export const getProjectsOptions = (options?: Options<GetProjectsData>) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getProjects({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getProjectsQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
export const createProjectQueryKey = (options: Options<CreateProjectData>) =>
|
||||
createQueryKey("createProject", options);
|
||||
|
||||
/**
|
||||
* Create Project
|
||||
*/
|
||||
export const createProjectOptions = (options: Options<CreateProjectData>) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await createProject({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: createProjectQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Create Project
|
||||
*/
|
||||
export const createProjectMutation = (
|
||||
options?: Partial<Options<CreateProjectData>>
|
||||
): UseMutationOptions<
|
||||
CreateProjectResponse2,
|
||||
AxiosError<CreateProjectError>,
|
||||
Options<CreateProjectData>
|
||||
> => {
|
||||
const mutationOptions: UseMutationOptions<
|
||||
CreateProjectResponse2,
|
||||
AxiosError<CreateProjectError>,
|
||||
Options<CreateProjectData>
|
||||
> = {
|
||||
mutationFn: async localOptions => {
|
||||
const { data } = await createProject({
|
||||
...options,
|
||||
...localOptions,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* Delete Project
|
||||
*/
|
||||
export const deleteProjectMutation = (
|
||||
options?: Partial<Options<DeleteProjectData>>
|
||||
): UseMutationOptions<
|
||||
DeleteProjectResponse2,
|
||||
AxiosError<DeleteProjectError>,
|
||||
Options<DeleteProjectData>
|
||||
> => {
|
||||
const mutationOptions: UseMutationOptions<
|
||||
DeleteProjectResponse2,
|
||||
AxiosError<DeleteProjectError>,
|
||||
Options<DeleteProjectData>
|
||||
> = {
|
||||
mutationFn: async localOptions => {
|
||||
const { data } = await deleteProject({
|
||||
...options,
|
||||
...localOptions,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* Update Project
|
||||
*/
|
||||
export const updateProjectMutation = (
|
||||
options?: Partial<Options<UpdateProjectData>>
|
||||
): UseMutationOptions<
|
||||
UpdateProjectResponse2,
|
||||
AxiosError<UpdateProjectError>,
|
||||
Options<UpdateProjectData>
|
||||
> => {
|
||||
const mutationOptions: UseMutationOptions<
|
||||
UpdateProjectResponse2,
|
||||
AxiosError<UpdateProjectError>,
|
||||
Options<UpdateProjectData>
|
||||
> = {
|
||||
mutationFn: async localOptions => {
|
||||
const { data } = await updateProject({
|
||||
...options,
|
||||
...localOptions,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const getStatusesQueryKey = (options: Options<GetStatusesData>) =>
|
||||
createQueryKey("getStatuses", options);
|
||||
|
||||
/**
|
||||
* Get Statuses
|
||||
*/
|
||||
export const getStatusesOptions = (options: Options<GetStatusesData>) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getStatuses({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getStatusesQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
export const createStatusQueryKey = (options: Options<CreateStatusData>) =>
|
||||
createQueryKey("createStatus", options);
|
||||
|
||||
/**
|
||||
* Create Status
|
||||
*/
|
||||
export const createStatusOptions = (options: Options<CreateStatusData>) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await createStatus({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: createStatusQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Create Status
|
||||
*/
|
||||
export const createStatusMutation = (
|
||||
options?: Partial<Options<CreateStatusData>>
|
||||
): UseMutationOptions<
|
||||
CreateStatusResponse2,
|
||||
AxiosError<CreateStatusError>,
|
||||
Options<CreateStatusData>
|
||||
> => {
|
||||
const mutationOptions: UseMutationOptions<
|
||||
CreateStatusResponse2,
|
||||
AxiosError<CreateStatusError>,
|
||||
Options<CreateStatusData>
|
||||
> = {
|
||||
mutationFn: async localOptions => {
|
||||
const { data } = await createStatus({
|
||||
...options,
|
||||
...localOptions,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* Delete Status
|
||||
*/
|
||||
export const deleteStatusMutation = (
|
||||
options?: Partial<Options<DeleteStatusData>>
|
||||
): UseMutationOptions<
|
||||
DeleteStatusResponse2,
|
||||
AxiosError<DeleteStatusError>,
|
||||
Options<DeleteStatusData>
|
||||
> => {
|
||||
const mutationOptions: UseMutationOptions<
|
||||
DeleteStatusResponse2,
|
||||
AxiosError<DeleteStatusError>,
|
||||
Options<DeleteStatusData>
|
||||
> = {
|
||||
mutationFn: async localOptions => {
|
||||
const { data } = await deleteStatus({
|
||||
...options,
|
||||
...localOptions,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* Update Status
|
||||
*/
|
||||
export const updateStatusMutation = (
|
||||
options?: Partial<Options<UpdateStatusData>>
|
||||
): UseMutationOptions<
|
||||
UpdateStatusResponse2,
|
||||
AxiosError<UpdateStatusError>,
|
||||
Options<UpdateStatusData>
|
||||
> => {
|
||||
const mutationOptions: UseMutationOptions<
|
||||
UpdateStatusResponse2,
|
||||
AxiosError<UpdateStatusError>,
|
||||
Options<UpdateStatusData>
|
||||
> = {
|
||||
mutationFn: async localOptions => {
|
||||
const { data } = await updateStatus({
|
||||
...options,
|
||||
...localOptions,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const getStatusHistoryQueryKey = (
|
||||
options: Options<GetStatusHistoryData>
|
||||
) => createQueryKey("getStatusHistory", options);
|
||||
|
||||
/**
|
||||
* Get Status History
|
||||
*/
|
||||
export const getStatusHistoryOptions = (
|
||||
options: Options<GetStatusHistoryData>
|
||||
) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getStatusHistory({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getStatusHistoryQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
export const getClientsQueryKey = (options?: Options<GetClientsData>) =>
|
||||
createQueryKey("getClients", options);
|
||||
|
||||
@ -2643,3 +2373,273 @@ export const updateServicesKitMutation = (
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const getProjectsQueryKey = (options?: Options<GetProjectsData>) =>
|
||||
createQueryKey("getProjects", options);
|
||||
|
||||
/**
|
||||
* Get Projects
|
||||
*/
|
||||
export const getProjectsOptions = (options?: Options<GetProjectsData>) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getProjects({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getProjectsQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
export const createProjectQueryKey = (options: Options<CreateProjectData>) =>
|
||||
createQueryKey("createProject", options);
|
||||
|
||||
/**
|
||||
* Create Project
|
||||
*/
|
||||
export const createProjectOptions = (options: Options<CreateProjectData>) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await createProject({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: createProjectQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Create Project
|
||||
*/
|
||||
export const createProjectMutation = (
|
||||
options?: Partial<Options<CreateProjectData>>
|
||||
): UseMutationOptions<
|
||||
CreateProjectResponse2,
|
||||
AxiosError<CreateProjectError>,
|
||||
Options<CreateProjectData>
|
||||
> => {
|
||||
const mutationOptions: UseMutationOptions<
|
||||
CreateProjectResponse2,
|
||||
AxiosError<CreateProjectError>,
|
||||
Options<CreateProjectData>
|
||||
> = {
|
||||
mutationFn: async localOptions => {
|
||||
const { data } = await createProject({
|
||||
...options,
|
||||
...localOptions,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* Delete Project
|
||||
*/
|
||||
export const deleteProjectMutation = (
|
||||
options?: Partial<Options<DeleteProjectData>>
|
||||
): UseMutationOptions<
|
||||
DeleteProjectResponse2,
|
||||
AxiosError<DeleteProjectError>,
|
||||
Options<DeleteProjectData>
|
||||
> => {
|
||||
const mutationOptions: UseMutationOptions<
|
||||
DeleteProjectResponse2,
|
||||
AxiosError<DeleteProjectError>,
|
||||
Options<DeleteProjectData>
|
||||
> = {
|
||||
mutationFn: async localOptions => {
|
||||
const { data } = await deleteProject({
|
||||
...options,
|
||||
...localOptions,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* Update Project
|
||||
*/
|
||||
export const updateProjectMutation = (
|
||||
options?: Partial<Options<UpdateProjectData>>
|
||||
): UseMutationOptions<
|
||||
UpdateProjectResponse2,
|
||||
AxiosError<UpdateProjectError>,
|
||||
Options<UpdateProjectData>
|
||||
> => {
|
||||
const mutationOptions: UseMutationOptions<
|
||||
UpdateProjectResponse2,
|
||||
AxiosError<UpdateProjectError>,
|
||||
Options<UpdateProjectData>
|
||||
> = {
|
||||
mutationFn: async localOptions => {
|
||||
const { data } = await updateProject({
|
||||
...options,
|
||||
...localOptions,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const getStatusesQueryKey = (options: Options<GetStatusesData>) =>
|
||||
createQueryKey("getStatuses", options);
|
||||
|
||||
/**
|
||||
* Get Statuses
|
||||
*/
|
||||
export const getStatusesOptions = (options: Options<GetStatusesData>) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getStatuses({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getStatusesQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
export const createStatusQueryKey = (options: Options<CreateStatusData>) =>
|
||||
createQueryKey("createStatus", options);
|
||||
|
||||
/**
|
||||
* Create Status
|
||||
*/
|
||||
export const createStatusOptions = (options: Options<CreateStatusData>) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await createStatus({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: createStatusQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Create Status
|
||||
*/
|
||||
export const createStatusMutation = (
|
||||
options?: Partial<Options<CreateStatusData>>
|
||||
): UseMutationOptions<
|
||||
CreateStatusResponse2,
|
||||
AxiosError<CreateStatusError>,
|
||||
Options<CreateStatusData>
|
||||
> => {
|
||||
const mutationOptions: UseMutationOptions<
|
||||
CreateStatusResponse2,
|
||||
AxiosError<CreateStatusError>,
|
||||
Options<CreateStatusData>
|
||||
> = {
|
||||
mutationFn: async localOptions => {
|
||||
const { data } = await createStatus({
|
||||
...options,
|
||||
...localOptions,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* Delete Status
|
||||
*/
|
||||
export const deleteStatusMutation = (
|
||||
options?: Partial<Options<DeleteStatusData>>
|
||||
): UseMutationOptions<
|
||||
DeleteStatusResponse2,
|
||||
AxiosError<DeleteStatusError>,
|
||||
Options<DeleteStatusData>
|
||||
> => {
|
||||
const mutationOptions: UseMutationOptions<
|
||||
DeleteStatusResponse2,
|
||||
AxiosError<DeleteStatusError>,
|
||||
Options<DeleteStatusData>
|
||||
> = {
|
||||
mutationFn: async localOptions => {
|
||||
const { data } = await deleteStatus({
|
||||
...options,
|
||||
...localOptions,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* Update Status
|
||||
*/
|
||||
export const updateStatusMutation = (
|
||||
options?: Partial<Options<UpdateStatusData>>
|
||||
): UseMutationOptions<
|
||||
UpdateStatusResponse2,
|
||||
AxiosError<UpdateStatusError>,
|
||||
Options<UpdateStatusData>
|
||||
> => {
|
||||
const mutationOptions: UseMutationOptions<
|
||||
UpdateStatusResponse2,
|
||||
AxiosError<UpdateStatusError>,
|
||||
Options<UpdateStatusData>
|
||||
> = {
|
||||
mutationFn: async localOptions => {
|
||||
const { data } = await updateStatus({
|
||||
...options,
|
||||
...localOptions,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const getStatusHistoryQueryKey = (
|
||||
options: Options<GetStatusHistoryData>
|
||||
) => createQueryKey("getStatusHistory", options);
|
||||
|
||||
/**
|
||||
* Get Status History
|
||||
*/
|
||||
export const getStatusHistoryOptions = (
|
||||
options: Options<GetStatusHistoryData>
|
||||
) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getStatusHistory({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getStatusHistoryQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user