feat(api): generate API models and hooks for public shop configuration and commerce entities
- Added generated API hooks and models for public shop configuration, including listing and retrieving configurations. - Introduced models for commerce categories, discount codes, orders, product images, and products with pagination and search parameters. - Ensured all generated files are structured for easy integration with React Query.
This commit is contained in:
88
frontend/src/api/generated/public/advertisement.ts
Normal file
88
frontend/src/api/generated/public/advertisement.ts
Normal file
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* Generated by orval v7.17.0 🍺
|
||||
* Do not edit manually.
|
||||
* OpenAPI spec version: 0.0.0
|
||||
*/
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import type {
|
||||
MutationFunction,
|
||||
QueryClient,
|
||||
UseMutationOptions,
|
||||
UseMutationResult,
|
||||
} from "@tanstack/react-query";
|
||||
|
||||
import { publicMutator } from "../../publicClient";
|
||||
|
||||
export const apiAdvertisementContactMeCreate = (signal?: AbortSignal) => {
|
||||
return publicMutator<void>({
|
||||
url: `/api/advertisement/contact-me/`,
|
||||
method: "POST",
|
||||
signal,
|
||||
});
|
||||
};
|
||||
|
||||
export const getApiAdvertisementContactMeCreateMutationOptions = <
|
||||
TError = unknown,
|
||||
TContext = unknown,
|
||||
>(options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<ReturnType<typeof apiAdvertisementContactMeCreate>>,
|
||||
TError,
|
||||
void,
|
||||
TContext
|
||||
>;
|
||||
}): UseMutationOptions<
|
||||
Awaited<ReturnType<typeof apiAdvertisementContactMeCreate>>,
|
||||
TError,
|
||||
void,
|
||||
TContext
|
||||
> => {
|
||||
const mutationKey = ["apiAdvertisementContactMeCreate"];
|
||||
const { mutation: mutationOptions } = options
|
||||
? options.mutation &&
|
||||
"mutationKey" in options.mutation &&
|
||||
options.mutation.mutationKey
|
||||
? options
|
||||
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
||||
: { mutation: { mutationKey } };
|
||||
|
||||
const mutationFn: MutationFunction<
|
||||
Awaited<ReturnType<typeof apiAdvertisementContactMeCreate>>,
|
||||
void
|
||||
> = () => {
|
||||
return apiAdvertisementContactMeCreate();
|
||||
};
|
||||
|
||||
return { mutationFn, ...mutationOptions };
|
||||
};
|
||||
|
||||
export type ApiAdvertisementContactMeCreateMutationResult = NonNullable<
|
||||
Awaited<ReturnType<typeof apiAdvertisementContactMeCreate>>
|
||||
>;
|
||||
|
||||
export type ApiAdvertisementContactMeCreateMutationError = unknown;
|
||||
|
||||
export const useApiAdvertisementContactMeCreate = <
|
||||
TError = unknown,
|
||||
TContext = unknown,
|
||||
>(
|
||||
options?: {
|
||||
mutation?: UseMutationOptions<
|
||||
Awaited<ReturnType<typeof apiAdvertisementContactMeCreate>>,
|
||||
TError,
|
||||
void,
|
||||
TContext
|
||||
>;
|
||||
},
|
||||
queryClient?: QueryClient,
|
||||
): UseMutationResult<
|
||||
Awaited<ReturnType<typeof apiAdvertisementContactMeCreate>>,
|
||||
TError,
|
||||
void,
|
||||
TContext
|
||||
> => {
|
||||
const mutationOptions =
|
||||
getApiAdvertisementContactMeCreateMutationOptions(options);
|
||||
|
||||
return useMutation(mutationOptions, queryClient);
|
||||
};
|
||||
Reference in New Issue
Block a user