feat: tags page for mobiles
This commit is contained in:
@ -60,6 +60,7 @@ import {
|
||||
getMarketplaces,
|
||||
getProductBarcodePdf,
|
||||
getProducts,
|
||||
getProject,
|
||||
getProjects,
|
||||
getServiceCategories,
|
||||
getServices,
|
||||
@ -214,6 +215,7 @@ import type {
|
||||
GetProductsData,
|
||||
GetProductsError,
|
||||
GetProductsResponse2,
|
||||
GetProjectData,
|
||||
GetProjectsData,
|
||||
GetServiceCategoriesData,
|
||||
GetServicesData,
|
||||
@ -2714,6 +2716,27 @@ export const deleteProjectMutation = (
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const getProjectQueryKey = (options: Options<GetProjectData>) =>
|
||||
createQueryKey("getProject", options);
|
||||
|
||||
/**
|
||||
* Get Project
|
||||
*/
|
||||
export const getProjectOptions = (options: Options<GetProjectData>) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getProject({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getProjectQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Update Project
|
||||
*/
|
||||
|
||||
@ -147,6 +147,9 @@ import type {
|
||||
GetProductsData,
|
||||
GetProductsErrors,
|
||||
GetProductsResponses,
|
||||
GetProjectData,
|
||||
GetProjectErrors,
|
||||
GetProjectResponses,
|
||||
GetProjectsData,
|
||||
GetProjectsResponses,
|
||||
GetServiceCategoriesData,
|
||||
@ -317,6 +320,8 @@ import {
|
||||
zGetProductBarcodePdfResponse2,
|
||||
zGetProductsData,
|
||||
zGetProductsResponse2,
|
||||
zGetProjectData,
|
||||
zGetProjectResponse2,
|
||||
zGetProjectsData,
|
||||
zGetProjectsResponse2,
|
||||
zGetServiceCategoriesData,
|
||||
@ -2090,6 +2095,29 @@ export const deleteProject = <ThrowOnError extends boolean = false>(
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Get Project
|
||||
*/
|
||||
export const getProject = <ThrowOnError extends boolean = false>(
|
||||
options: Options<GetProjectData, ThrowOnError>
|
||||
) => {
|
||||
return (options.client ?? _heyApiClient).get<
|
||||
GetProjectResponses,
|
||||
GetProjectErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
requestValidator: async data => {
|
||||
return await zGetProjectData.parseAsync(data);
|
||||
},
|
||||
responseType: "json",
|
||||
responseValidator: async data => {
|
||||
return await zGetProjectResponse2.parseAsync(data);
|
||||
},
|
||||
url: "/crm/v1/project/{pk}",
|
||||
...options,
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Update Project
|
||||
*/
|
||||
|
||||
@ -1400,6 +1400,13 @@ export type GetProductsResponse = {
|
||||
paginationInfo: PaginationInfoSchema;
|
||||
};
|
||||
|
||||
/**
|
||||
* GetProjectResponse
|
||||
*/
|
||||
export type GetProjectResponse = {
|
||||
entity: ProjectSchema;
|
||||
};
|
||||
|
||||
/**
|
||||
* GetProjectsResponse
|
||||
*/
|
||||
@ -4451,6 +4458,37 @@ export type DeleteProjectResponses = {
|
||||
export type DeleteProjectResponse2 =
|
||||
DeleteProjectResponses[keyof DeleteProjectResponses];
|
||||
|
||||
export type GetProjectData = {
|
||||
body?: never;
|
||||
path: {
|
||||
/**
|
||||
* Pk
|
||||
*/
|
||||
pk: number;
|
||||
};
|
||||
query?: never;
|
||||
url: "/crm/v1/project/{pk}";
|
||||
};
|
||||
|
||||
export type GetProjectErrors = {
|
||||
/**
|
||||
* Validation Error
|
||||
*/
|
||||
422: HttpValidationError;
|
||||
};
|
||||
|
||||
export type GetProjectError = GetProjectErrors[keyof GetProjectErrors];
|
||||
|
||||
export type GetProjectResponses = {
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
200: GetProjectResponse;
|
||||
};
|
||||
|
||||
export type GetProjectResponse2 =
|
||||
GetProjectResponses[keyof GetProjectResponses];
|
||||
|
||||
export type UpdateProjectData = {
|
||||
body: UpdateProjectRequest;
|
||||
path: {
|
||||
|
||||
@ -957,6 +957,13 @@ export const zGetProductsResponse = z.object({
|
||||
paginationInfo: zPaginationInfoSchema,
|
||||
});
|
||||
|
||||
/**
|
||||
* GetProjectResponse
|
||||
*/
|
||||
export const zGetProjectResponse = z.object({
|
||||
entity: zProjectSchema,
|
||||
});
|
||||
|
||||
/**
|
||||
* GetProjectsResponse
|
||||
*/
|
||||
@ -2329,6 +2336,19 @@ export const zDeleteProjectData = z.object({
|
||||
*/
|
||||
export const zDeleteProjectResponse2 = zDeleteProjectResponse;
|
||||
|
||||
export const zGetProjectData = z.object({
|
||||
body: z.optional(z.never()),
|
||||
path: z.object({
|
||||
pk: z.int(),
|
||||
}),
|
||||
query: z.optional(z.never()),
|
||||
});
|
||||
|
||||
/**
|
||||
* Successful Response
|
||||
*/
|
||||
export const zGetProjectResponse2 = zGetProjectResponse;
|
||||
|
||||
export const zUpdateProjectData = z.object({
|
||||
body: zUpdateProjectRequest,
|
||||
path: z.object({
|
||||
|
||||
Reference in New Issue
Block a user