Commit b3589a95 authored by Lê Bảo Hồng Đức's avatar Lê Bảo Hồng Đức

[tag]0.1-vcci

parents 607b1419 20eb9ce4
Pipeline #52396 failed with stages
in 1 minute and 56 seconds
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -40,23 +40,52 @@ const swaggerCandidates = [
async function fetchSwagger() {
for (const url of swaggerCandidates) {
if (typeof url === "string" && fs.existsSync(url)) {
return JSON.parse(fs.readFileSync(url, "utf8"));
if (!url) continue;
// 1) Local file path
if (fs.existsSync(url) && fs.statSync(url).isFile()) {
const raw = fs.readFileSync(url, "utf8");
try {
return JSON.parse(raw);
} catch (error) {
throw new Error(`Swagger spec tại ${url} không phải JSON hợp lệ: ${error}`);
}
}
// 2) HTTP fetch — chỉ chấp nhận JSON, bỏ qua HTML (404, page app,...)
if (/^https?:\/\//i.test(url)) {
try {
const { data } = await axios.get(url, {
const { data, headers } = await axios.get(url, {
headers: { Origin: siteURL },
// Ngăn axios tự nhận HTML là JSON — ép raw response để check Content-Type
responseType: "json",
validateStatus: (status) => status >= 200 && status < 400,
});
const contentType = String(headers?.["content-type"] ?? "").toLowerCase();
if (!contentType.includes("application/json") && typeof data === "string") {
// Phản hồi không phải JSON (thường là HTML 404) — bỏ qua candidate này
continue;
}
if (data && typeof data === "object") {
return data;
}
} catch {
continue;
}
}
}
// 3) Fallback cuối: openapi/swagger-output.json nằm trong repo
const localSwagger = path.resolve(process.cwd(), "openapi/swagger-output.json");
if (fs.existsSync(localSwagger)) {
return JSON.parse(fs.readFileSync(localSwagger, "utf8"));
const raw = fs.readFileSync(localSwagger, "utf8");
try {
return JSON.parse(raw);
} catch (error) {
throw new Error(`Swagger spec tại ${localSwagger} không phải JSON hợp lệ: ${error}`);
}
}
throw new Error(
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import {
......@@ -30,12 +30,12 @@ import type {
} from '@tanstack/react-query';
import type {
BannerMutate,
DeleteBannerId200,
GetBannerId200,
GetBannerParams,
PostBanner200,
PutBannerId200,
BannerCreate,
DeleteApiV10BannerId200,
GetApiV10BannerId200,
GetApiV10BannerParams,
PostApiV10Banner200,
PutApiV10BannerId200,
ResponseGetAllData
} from '../models';
......@@ -52,36 +52,36 @@ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
* Retrieve a single banner record by its ID
* @summary Get banner by ID
*/
export type getBannerIdResponse200 = {
data: GetBannerId200
export type getApiV10BannerIdResponse200 = {
data: GetApiV10BannerId200
status: 200
}
export type getBannerIdResponse404 = {
export type getApiV10BannerIdResponse404 = {
data: void
status: 404
}
export type getBannerIdResponseSuccess = (getBannerIdResponse200) & {
export type getApiV10BannerIdResponseSuccess = (getApiV10BannerIdResponse200) & {
headers: Headers;
};
export type getBannerIdResponseError = (getBannerIdResponse404) & {
export type getApiV10BannerIdResponseError = (getApiV10BannerIdResponse404) & {
headers: Headers;
};
export type getBannerIdResponse = (getBannerIdResponseSuccess | getBannerIdResponseError)
export type getApiV10BannerIdResponse = (getApiV10BannerIdResponseSuccess | getApiV10BannerIdResponseError)
export const getGetBannerIdUrl = (id: string,) => {
export const getGetApiV10BannerIdUrl = (id: string,) => {
return `/banner/${id}`
return `/api/v1.0/banner/${id}`
}
export const getBannerId = async (id: string, options?: RequestInit): Promise<getBannerIdResponse> => {
export const getApiV10BannerId = async (id: string, options?: RequestInit): Promise<getApiV10BannerIdResponse> => {
return useCustomClient<getBannerIdResponse>(getGetBannerIdUrl(id),
return useCustomClient<getApiV10BannerIdResponse>(getGetApiV10BannerIdUrl(id),
{
...options,
method: 'GET'
......@@ -94,75 +94,75 @@ export const getBannerId = async (id: string, options?: RequestInit): Promise<ge
export const getGetBannerIdInfiniteQueryKey = (id?: string,) => {
export const getGetApiV10BannerIdInfiniteQueryKey = (id?: string,) => {
return [
'infinite', `/banner/${id}`
'infinite', `/api/v1.0/banner/${id}`
] as const;
}
export const getGetBannerIdQueryKey = (id?: string,) => {
export const getGetApiV10BannerIdQueryKey = (id?: string,) => {
return [
`/banner/${id}`
`/api/v1.0/banner/${id}`
] as const;
}
export const getGetBannerIdInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getBannerId>>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10BannerIdInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getApiV10BannerId>>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10BannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetBannerIdInfiniteQueryKey(id);
const queryKey = queryOptions?.queryKey ?? getGetApiV10BannerIdInfiniteQueryKey(id);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getBannerId>>> = ({ signal }) => getBannerId(id, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10BannerId>>> = ({ signal }) => getApiV10BannerId(id, { signal, ...requestOptions });
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10BannerId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetBannerIdInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getBannerId>>>
export type GetBannerIdInfiniteQueryError = ErrorType<void>
export type GetApiV10BannerIdInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10BannerId>>>
export type GetApiV10BannerIdInfiniteQueryError = ErrorType<void>
export function useGetBannerIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getBannerId>>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>> & Pick<
export function useGetApiV10BannerIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10BannerId>>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10BannerId>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getBannerId>>,
Awaited<ReturnType<typeof getApiV10BannerId>>,
TError,
Awaited<ReturnType<typeof getBannerId>>
Awaited<ReturnType<typeof getApiV10BannerId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetBannerIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getBannerId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>> & Pick<
export function useGetApiV10BannerIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10BannerId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10BannerId>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getBannerId>>,
Awaited<ReturnType<typeof getApiV10BannerId>>,
TError,
Awaited<ReturnType<typeof getBannerId>>
Awaited<ReturnType<typeof getApiV10BannerId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetBannerIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getBannerId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10BannerIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10BannerId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10BannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get banner by ID
*/
export function useGetBannerIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getBannerId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10BannerIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10BannerId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10BannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetBannerIdInfiniteQueryOptions(id,options)
const queryOptions = getGetApiV10BannerIdInfiniteQueryOptions(id,options)
const query = useInfiniteQuery(queryOptions, queryClient) as UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -174,12 +174,12 @@ export function useGetBannerIdInfinite<TData = InfiniteData<Awaited<ReturnType<t
/**
* @summary Get banner by ID
*/
export const prefetchGetBannerIdInfiniteQuery = async <TData = Awaited<ReturnType<typeof getBannerId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10BannerIdInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10BannerId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10BannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetBannerIdInfiniteQueryOptions(id,options)
const queryOptions = getGetApiV10BannerIdInfiniteQueryOptions(id,options)
await queryClient.prefetchInfiniteQuery(queryOptions);
......@@ -188,62 +188,62 @@ export const prefetchGetBannerIdInfiniteQuery = async <TData = Awaited<ReturnTyp
export const getGetBannerIdQueryOptions = <TData = Awaited<ReturnType<typeof getBannerId>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10BannerIdQueryOptions = <TData = Awaited<ReturnType<typeof getApiV10BannerId>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10BannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetBannerIdQueryKey(id);
const queryKey = queryOptions?.queryKey ?? getGetApiV10BannerIdQueryKey(id);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getBannerId>>> = ({ signal }) => getBannerId(id, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10BannerId>>> = ({ signal }) => getApiV10BannerId(id, { signal, ...requestOptions });
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApiV10BannerId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetBannerIdQueryResult = NonNullable<Awaited<ReturnType<typeof getBannerId>>>
export type GetBannerIdQueryError = ErrorType<void>
export type GetApiV10BannerIdQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10BannerId>>>
export type GetApiV10BannerIdQueryError = ErrorType<void>
export function useGetBannerId<TData = Awaited<ReturnType<typeof getBannerId>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>> & Pick<
export function useGetApiV10BannerId<TData = Awaited<ReturnType<typeof getApiV10BannerId>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10BannerId>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getBannerId>>,
Awaited<ReturnType<typeof getApiV10BannerId>>,
TError,
Awaited<ReturnType<typeof getBannerId>>
Awaited<ReturnType<typeof getApiV10BannerId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetBannerId<TData = Awaited<ReturnType<typeof getBannerId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>> & Pick<
export function useGetApiV10BannerId<TData = Awaited<ReturnType<typeof getApiV10BannerId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10BannerId>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getBannerId>>,
Awaited<ReturnType<typeof getApiV10BannerId>>,
TError,
Awaited<ReturnType<typeof getBannerId>>
Awaited<ReturnType<typeof getApiV10BannerId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetBannerId<TData = Awaited<ReturnType<typeof getBannerId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10BannerId<TData = Awaited<ReturnType<typeof getApiV10BannerId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10BannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get banner by ID
*/
export function useGetBannerId<TData = Awaited<ReturnType<typeof getBannerId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10BannerId<TData = Awaited<ReturnType<typeof getApiV10BannerId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10BannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetBannerIdQueryOptions(id,options)
const queryOptions = getGetApiV10BannerIdQueryOptions(id,options)
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -255,12 +255,12 @@ export function useGetBannerId<TData = Awaited<ReturnType<typeof getBannerId>>,
/**
* @summary Get banner by ID
*/
export const prefetchGetBannerIdQuery = async <TData = Awaited<ReturnType<typeof getBannerId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10BannerIdQuery = async <TData = Awaited<ReturnType<typeof getApiV10BannerId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10BannerId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetBannerIdQueryOptions(id,options)
const queryOptions = getGetApiV10BannerIdQueryOptions(id,options)
await queryClient.prefetchQuery(queryOptions);
......@@ -273,54 +273,54 @@ export const prefetchGetBannerIdQuery = async <TData = Awaited<ReturnType<typeof
* Update a single banner record by its ID
* @summary Update banner by ID
*/
export type putBannerIdResponse200 = {
data: PutBannerId200
export type putApiV10BannerIdResponse200 = {
data: PutApiV10BannerId200
status: 200
}
export type putBannerIdResponse404 = {
export type putApiV10BannerIdResponse404 = {
data: void
status: 404
}
export type putBannerIdResponseSuccess = (putBannerIdResponse200) & {
export type putApiV10BannerIdResponseSuccess = (putApiV10BannerIdResponse200) & {
headers: Headers;
};
export type putBannerIdResponseError = (putBannerIdResponse404) & {
export type putApiV10BannerIdResponseError = (putApiV10BannerIdResponse404) & {
headers: Headers;
};
export type putBannerIdResponse = (putBannerIdResponseSuccess | putBannerIdResponseError)
export type putApiV10BannerIdResponse = (putApiV10BannerIdResponseSuccess | putApiV10BannerIdResponseError)
export const getPutBannerIdUrl = (id: string,) => {
export const getPutApiV10BannerIdUrl = (id: string,) => {
return `/banner/${id}`
return `/api/v1.0/banner/${id}`
}
export const putBannerId = async (id: string,
bannerMutate: BannerMutate, options?: RequestInit): Promise<putBannerIdResponse> => {
export const putApiV10BannerId = async (id: string,
bannerCreate: BannerCreate, options?: RequestInit): Promise<putApiV10BannerIdResponse> => {
return useCustomClient<putBannerIdResponse>(getPutBannerIdUrl(id),
return useCustomClient<putApiV10BannerIdResponse>(getPutApiV10BannerIdUrl(id),
{
...options,
method: 'PUT',
headers: { 'Content-Type': 'application/json', ...options?.headers },
body: JSON.stringify(
bannerMutate,)
bannerCreate,)
}
);}
export const getPutBannerIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putBannerId>>, TError,{id: string;data: BodyType<BannerMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof putBannerId>>, TError,{id: string;data: BodyType<BannerMutate>}, TContext> => {
export const getPutApiV10BannerIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putApiV10BannerId>>, TError,{id: string;data: BodyType<BannerCreate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof putApiV10BannerId>>, TError,{id: string;data: BodyType<BannerCreate>}, TContext> => {
const mutationKey = ['putBannerId'];
const mutationKey = ['putApiV10BannerId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -330,10 +330,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof putBannerId>>, {id: string;data: BodyType<BannerMutate>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof putApiV10BannerId>>, {id: string;data: BodyType<BannerCreate>}> = (props) => {
const {id,data} = props ?? {};
return putBannerId(id,data,requestOptions)
return putApiV10BannerId(id,data,requestOptions)
}
......@@ -341,23 +341,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PutBannerIdMutationResult = NonNullable<Awaited<ReturnType<typeof putBannerId>>>
export type PutBannerIdMutationBody = BodyType<BannerMutate>
export type PutBannerIdMutationError = ErrorType<void>
export type PutApiV10BannerIdMutationResult = NonNullable<Awaited<ReturnType<typeof putApiV10BannerId>>>
export type PutApiV10BannerIdMutationBody = BodyType<BannerCreate>
export type PutApiV10BannerIdMutationError = ErrorType<void>
/**
* @summary Update banner by ID
*/
export const usePutBannerId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putBannerId>>, TError,{id: string;data: BodyType<BannerMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePutApiV10BannerId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putApiV10BannerId>>, TError,{id: string;data: BodyType<BannerCreate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof putBannerId>>,
Awaited<ReturnType<typeof putApiV10BannerId>>,
TError,
{id: string;data: BodyType<BannerMutate>},
{id: string;data: BodyType<BannerCreate>},
TContext
> => {
const mutationOptions = getPutBannerIdMutationOptions(options);
const mutationOptions = getPutApiV10BannerIdMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
......@@ -365,36 +365,36 @@ export const usePutBannerId = <TError = ErrorType<void>,
* Delete a single banner record by its ID
* @summary Delete banner by ID
*/
export type deleteBannerIdResponse200 = {
data: DeleteBannerId200
export type deleteApiV10BannerIdResponse200 = {
data: DeleteApiV10BannerId200
status: 200
}
export type deleteBannerIdResponse404 = {
export type deleteApiV10BannerIdResponse404 = {
data: void
status: 404
}
export type deleteBannerIdResponseSuccess = (deleteBannerIdResponse200) & {
export type deleteApiV10BannerIdResponseSuccess = (deleteApiV10BannerIdResponse200) & {
headers: Headers;
};
export type deleteBannerIdResponseError = (deleteBannerIdResponse404) & {
export type deleteApiV10BannerIdResponseError = (deleteApiV10BannerIdResponse404) & {
headers: Headers;
};
export type deleteBannerIdResponse = (deleteBannerIdResponseSuccess | deleteBannerIdResponseError)
export type deleteApiV10BannerIdResponse = (deleteApiV10BannerIdResponseSuccess | deleteApiV10BannerIdResponseError)
export const getDeleteBannerIdUrl = (id: string,) => {
export const getDeleteApiV10BannerIdUrl = (id: string,) => {
return `/banner/${id}`
return `/api/v1.0/banner/${id}`
}
export const deleteBannerId = async (id: string, options?: RequestInit): Promise<deleteBannerIdResponse> => {
export const deleteApiV10BannerId = async (id: string, options?: RequestInit): Promise<deleteApiV10BannerIdResponse> => {
return useCustomClient<deleteBannerIdResponse>(getDeleteBannerIdUrl(id),
return useCustomClient<deleteApiV10BannerIdResponse>(getDeleteApiV10BannerIdUrl(id),
{
...options,
method: 'DELETE'
......@@ -406,11 +406,11 @@ export const deleteBannerId = async (id: string, options?: RequestInit): Promise
export const getDeleteBannerIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteBannerId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof deleteBannerId>>, TError,{id: string}, TContext> => {
export const getDeleteApiV10BannerIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10BannerId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10BannerId>>, TError,{id: string}, TContext> => {
const mutationKey = ['deleteBannerId'];
const mutationKey = ['deleteApiV10BannerId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -420,10 +420,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteBannerId>>, {id: string}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteApiV10BannerId>>, {id: string}> = (props) => {
const {id} = props ?? {};
return deleteBannerId(id,requestOptions)
return deleteApiV10BannerId(id,requestOptions)
}
......@@ -431,23 +431,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type DeleteBannerIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteBannerId>>>
export type DeleteApiV10BannerIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteApiV10BannerId>>>
export type DeleteBannerIdMutationError = ErrorType<void>
export type DeleteApiV10BannerIdMutationError = ErrorType<void>
/**
* @summary Delete banner by ID
*/
export const useDeleteBannerId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteBannerId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const useDeleteApiV10BannerId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10BannerId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof deleteBannerId>>,
Awaited<ReturnType<typeof deleteApiV10BannerId>>,
TError,
{id: string},
TContext
> => {
const mutationOptions = getDeleteBannerIdMutationOptions(options);
const mutationOptions = getDeleteApiV10BannerIdMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
......@@ -455,19 +455,19 @@ export const useDeleteBannerId = <TError = ErrorType<void>,
* Retrieve a list of banner with pagination, filtering and sorting
* @summary Get all banner
*/
export type getBannerResponse200 = {
export type getApiV10BannerResponse200 = {
data: ResponseGetAllData
status: 200
}
export type getBannerResponseSuccess = (getBannerResponse200) & {
export type getApiV10BannerResponseSuccess = (getApiV10BannerResponse200) & {
headers: Headers;
};
;
export type getBannerResponse = (getBannerResponseSuccess)
export type getApiV10BannerResponse = (getApiV10BannerResponseSuccess)
export const getGetBannerUrl = (params?: GetBannerParams,) => {
export const getGetApiV10BannerUrl = (params?: GetApiV10BannerParams,) => {
const normalizedParams = new URLSearchParams();
Object.entries(params || {}).forEach(([key, value]) => {
......@@ -479,12 +479,12 @@ export const getGetBannerUrl = (params?: GetBannerParams,) => {
const stringifiedParams = normalizedParams.toString();
return stringifiedParams.length > 0 ? `/banner?${stringifiedParams}` : `/banner`
return stringifiedParams.length > 0 ? `/api/v1.0/banner?${stringifiedParams}` : `/api/v1.0/banner`
}
export const getBanner = async (params?: GetBannerParams, options?: RequestInit): Promise<getBannerResponse> => {
export const getApiV10Banner = async (params?: GetApiV10BannerParams, options?: RequestInit): Promise<getApiV10BannerResponse> => {
return useCustomClient<getBannerResponse>(getGetBannerUrl(params),
return useCustomClient<getApiV10BannerResponse>(getGetApiV10BannerUrl(params),
{
...options,
method: 'GET'
......@@ -497,75 +497,75 @@ export const getBanner = async (params?: GetBannerParams, options?: RequestInit)
export const getGetBannerInfiniteQueryKey = (params?: GetBannerParams,) => {
export const getGetApiV10BannerInfiniteQueryKey = (params?: GetApiV10BannerParams,) => {
return [
'infinite', `/banner`, ...(params ? [params]: [])
'infinite', `/api/v1.0/banner`, ...(params ? [params]: [])
] as const;
}
export const getGetBannerQueryKey = (params?: GetBannerParams,) => {
export const getGetApiV10BannerQueryKey = (params?: GetApiV10BannerParams,) => {
return [
`/banner`, ...(params ? [params]: [])
`/api/v1.0/banner`, ...(params ? [params]: [])
] as const;
}
export const getGetBannerInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getBanner>>>, TError = ErrorType<unknown>>(params?: GetBannerParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10BannerInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Banner>>>, TError = ErrorType<unknown>>(params?: GetApiV10BannerParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Banner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetBannerInfiniteQueryKey(params);
const queryKey = queryOptions?.queryKey ?? getGetApiV10BannerInfiniteQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getBanner>>> = ({ signal }) => getBanner(params, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10Banner>>> = ({ signal }) => getApiV10Banner(params, { signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Banner>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetBannerInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getBanner>>>
export type GetBannerInfiniteQueryError = ErrorType<unknown>
export type GetApiV10BannerInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10Banner>>>
export type GetApiV10BannerInfiniteQueryError = ErrorType<unknown>
export function useGetBannerInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getBanner>>>, TError = ErrorType<unknown>>(
params: undefined | GetBannerParams, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>> & Pick<
export function useGetApiV10BannerInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Banner>>>, TError = ErrorType<unknown>>(
params: undefined | GetApiV10BannerParams, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Banner>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getBanner>>,
Awaited<ReturnType<typeof getApiV10Banner>>,
TError,
Awaited<ReturnType<typeof getBanner>>
Awaited<ReturnType<typeof getApiV10Banner>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetBannerInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getBanner>>>, TError = ErrorType<unknown>>(
params?: GetBannerParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>> & Pick<
export function useGetApiV10BannerInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Banner>>>, TError = ErrorType<unknown>>(
params?: GetApiV10BannerParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Banner>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getBanner>>,
Awaited<ReturnType<typeof getApiV10Banner>>,
TError,
Awaited<ReturnType<typeof getBanner>>
Awaited<ReturnType<typeof getApiV10Banner>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetBannerInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getBanner>>>, TError = ErrorType<unknown>>(
params?: GetBannerParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10BannerInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Banner>>>, TError = ErrorType<unknown>>(
params?: GetApiV10BannerParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Banner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get all banner
*/
export function useGetBannerInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getBanner>>>, TError = ErrorType<unknown>>(
params?: GetBannerParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10BannerInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Banner>>>, TError = ErrorType<unknown>>(
params?: GetApiV10BannerParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Banner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetBannerInfiniteQueryOptions(params,options)
const queryOptions = getGetApiV10BannerInfiniteQueryOptions(params,options)
const query = useInfiniteQuery(queryOptions, queryClient) as UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -577,12 +577,12 @@ export function useGetBannerInfinite<TData = InfiniteData<Awaited<ReturnType<typ
/**
* @summary Get all banner
*/
export const prefetchGetBannerInfiniteQuery = async <TData = Awaited<ReturnType<typeof getBanner>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetBannerParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10BannerInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10Banner>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetApiV10BannerParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Banner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetBannerInfiniteQueryOptions(params,options)
const queryOptions = getGetApiV10BannerInfiniteQueryOptions(params,options)
await queryClient.prefetchInfiniteQuery(queryOptions);
......@@ -591,62 +591,62 @@ export const prefetchGetBannerInfiniteQuery = async <TData = Awaited<ReturnType<
export const getGetBannerQueryOptions = <TData = Awaited<ReturnType<typeof getBanner>>, TError = ErrorType<unknown>>(params?: GetBannerParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10BannerQueryOptions = <TData = Awaited<ReturnType<typeof getApiV10Banner>>, TError = ErrorType<unknown>>(params?: GetApiV10BannerParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Banner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetBannerQueryKey(params);
const queryKey = queryOptions?.queryKey ?? getGetApiV10BannerQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getBanner>>> = ({ signal }) => getBanner(params, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10Banner>>> = ({ signal }) => getApiV10Banner(params, { signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApiV10Banner>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetBannerQueryResult = NonNullable<Awaited<ReturnType<typeof getBanner>>>
export type GetBannerQueryError = ErrorType<unknown>
export type GetApiV10BannerQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10Banner>>>
export type GetApiV10BannerQueryError = ErrorType<unknown>
export function useGetBanner<TData = Awaited<ReturnType<typeof getBanner>>, TError = ErrorType<unknown>>(
params: undefined | GetBannerParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>> & Pick<
export function useGetApiV10Banner<TData = Awaited<ReturnType<typeof getApiV10Banner>>, TError = ErrorType<unknown>>(
params: undefined | GetApiV10BannerParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Banner>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getBanner>>,
Awaited<ReturnType<typeof getApiV10Banner>>,
TError,
Awaited<ReturnType<typeof getBanner>>
Awaited<ReturnType<typeof getApiV10Banner>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetBanner<TData = Awaited<ReturnType<typeof getBanner>>, TError = ErrorType<unknown>>(
params?: GetBannerParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>> & Pick<
export function useGetApiV10Banner<TData = Awaited<ReturnType<typeof getApiV10Banner>>, TError = ErrorType<unknown>>(
params?: GetApiV10BannerParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Banner>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getBanner>>,
Awaited<ReturnType<typeof getApiV10Banner>>,
TError,
Awaited<ReturnType<typeof getBanner>>
Awaited<ReturnType<typeof getApiV10Banner>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetBanner<TData = Awaited<ReturnType<typeof getBanner>>, TError = ErrorType<unknown>>(
params?: GetBannerParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10Banner<TData = Awaited<ReturnType<typeof getApiV10Banner>>, TError = ErrorType<unknown>>(
params?: GetApiV10BannerParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Banner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get all banner
*/
export function useGetBanner<TData = Awaited<ReturnType<typeof getBanner>>, TError = ErrorType<unknown>>(
params?: GetBannerParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10Banner<TData = Awaited<ReturnType<typeof getApiV10Banner>>, TError = ErrorType<unknown>>(
params?: GetApiV10BannerParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Banner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetBannerQueryOptions(params,options)
const queryOptions = getGetApiV10BannerQueryOptions(params,options)
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -658,12 +658,12 @@ export function useGetBanner<TData = Awaited<ReturnType<typeof getBanner>>, TErr
/**
* @summary Get all banner
*/
export const prefetchGetBannerQuery = async <TData = Awaited<ReturnType<typeof getBanner>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetBannerParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getBanner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10BannerQuery = async <TData = Awaited<ReturnType<typeof getApiV10Banner>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetApiV10BannerParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Banner>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetBannerQueryOptions(params,options)
const queryOptions = getGetApiV10BannerQueryOptions(params,options)
await queryClient.prefetchQuery(queryOptions);
......@@ -676,46 +676,46 @@ export const prefetchGetBannerQuery = async <TData = Awaited<ReturnType<typeof g
* Create a new banner record
* @summary Create a banner
*/
export type postBannerResponse200 = {
data: PostBanner200
export type postApiV10BannerResponse200 = {
data: PostApiV10Banner200
status: 200
}
export type postBannerResponseSuccess = (postBannerResponse200) & {
export type postApiV10BannerResponseSuccess = (postApiV10BannerResponse200) & {
headers: Headers;
};
;
export type postBannerResponse = (postBannerResponseSuccess)
export type postApiV10BannerResponse = (postApiV10BannerResponseSuccess)
export const getPostBannerUrl = () => {
export const getPostApiV10BannerUrl = () => {
return `/banner`
return `/api/v1.0/banner`
}
export const postBanner = async (bannerMutate: BannerMutate, options?: RequestInit): Promise<postBannerResponse> => {
export const postApiV10Banner = async (bannerCreate: BannerCreate, options?: RequestInit): Promise<postApiV10BannerResponse> => {
return useCustomClient<postBannerResponse>(getPostBannerUrl(),
return useCustomClient<postApiV10BannerResponse>(getPostApiV10BannerUrl(),
{
...options,
method: 'POST',
headers: { 'Content-Type': 'application/json', ...options?.headers },
body: JSON.stringify(
bannerMutate,)
bannerCreate,)
}
);}
export const getPostBannerMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postBanner>>, TError,{data: BodyType<BannerMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postBanner>>, TError,{data: BodyType<BannerMutate>}, TContext> => {
export const getPostApiV10BannerMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postApiV10Banner>>, TError,{data: BodyType<BannerCreate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postApiV10Banner>>, TError,{data: BodyType<BannerCreate>}, TContext> => {
const mutationKey = ['postBanner'];
const mutationKey = ['postApiV10Banner'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -725,10 +725,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof postBanner>>, {data: BodyType<BannerMutate>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof postApiV10Banner>>, {data: BodyType<BannerCreate>}> = (props) => {
const {data} = props ?? {};
return postBanner(data,requestOptions)
return postApiV10Banner(data,requestOptions)
}
......@@ -736,23 +736,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PostBannerMutationResult = NonNullable<Awaited<ReturnType<typeof postBanner>>>
export type PostBannerMutationBody = BodyType<BannerMutate>
export type PostBannerMutationError = ErrorType<unknown>
export type PostApiV10BannerMutationResult = NonNullable<Awaited<ReturnType<typeof postApiV10Banner>>>
export type PostApiV10BannerMutationBody = BodyType<BannerCreate>
export type PostApiV10BannerMutationError = ErrorType<unknown>
/**
* @summary Create a banner
*/
export const usePostBanner = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postBanner>>, TError,{data: BodyType<BannerMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePostApiV10Banner = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postApiV10Banner>>, TError,{data: BodyType<BannerCreate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof postBanner>>,
Awaited<ReturnType<typeof postApiV10Banner>>,
TError,
{data: BodyType<BannerMutate>},
{data: BodyType<BannerCreate>},
TContext
> => {
const mutationOptions = getPostBannerMutationOptions(options);
const mutationOptions = getPostApiV10BannerMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import {
......@@ -31,11 +31,11 @@ import type {
import type {
CategoryMutate,
DeleteCategoryId200,
GetCategoryId200,
GetCategoryParams,
PostCategory200,
PutCategoryId200,
DeleteApiV10CategoryId200,
GetApiV10CategoryId200,
GetApiV10CategoryParams,
PostApiV10Category200,
PutApiV10CategoryId200,
ResponseGetAllData
} from '../models';
......@@ -52,36 +52,36 @@ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
* Retrieve a single category record by its ID
* @summary Get category by ID
*/
export type getCategoryIdResponse200 = {
data: GetCategoryId200
export type getApiV10CategoryIdResponse200 = {
data: GetApiV10CategoryId200
status: 200
}
export type getCategoryIdResponse404 = {
export type getApiV10CategoryIdResponse404 = {
data: void
status: 404
}
export type getCategoryIdResponseSuccess = (getCategoryIdResponse200) & {
export type getApiV10CategoryIdResponseSuccess = (getApiV10CategoryIdResponse200) & {
headers: Headers;
};
export type getCategoryIdResponseError = (getCategoryIdResponse404) & {
export type getApiV10CategoryIdResponseError = (getApiV10CategoryIdResponse404) & {
headers: Headers;
};
export type getCategoryIdResponse = (getCategoryIdResponseSuccess | getCategoryIdResponseError)
export type getApiV10CategoryIdResponse = (getApiV10CategoryIdResponseSuccess | getApiV10CategoryIdResponseError)
export const getGetCategoryIdUrl = (id: string,) => {
export const getGetApiV10CategoryIdUrl = (id: string,) => {
return `/category/${id}`
return `/api/v1.0/category/${id}`
}
export const getCategoryId = async (id: string, options?: RequestInit): Promise<getCategoryIdResponse> => {
export const getApiV10CategoryId = async (id: string, options?: RequestInit): Promise<getApiV10CategoryIdResponse> => {
return useCustomClient<getCategoryIdResponse>(getGetCategoryIdUrl(id),
return useCustomClient<getApiV10CategoryIdResponse>(getGetApiV10CategoryIdUrl(id),
{
...options,
method: 'GET'
......@@ -94,75 +94,75 @@ export const getCategoryId = async (id: string, options?: RequestInit): Promise<
export const getGetCategoryIdInfiniteQueryKey = (id?: string,) => {
export const getGetApiV10CategoryIdInfiniteQueryKey = (id?: string,) => {
return [
'infinite', `/category/${id}`
'infinite', `/api/v1.0/category/${id}`
] as const;
}
export const getGetCategoryIdQueryKey = (id?: string,) => {
export const getGetApiV10CategoryIdQueryKey = (id?: string,) => {
return [
`/category/${id}`
`/api/v1.0/category/${id}`
] as const;
}
export const getGetCategoryIdInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getCategoryId>>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getCategoryId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10CategoryIdInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getApiV10CategoryId>>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10CategoryId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetCategoryIdInfiniteQueryKey(id);
const queryKey = queryOptions?.queryKey ?? getGetApiV10CategoryIdInfiniteQueryKey(id);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getCategoryId>>> = ({ signal }) => getCategoryId(id, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10CategoryId>>> = ({ signal }) => getApiV10CategoryId(id, { signal, ...requestOptions });
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getCategoryId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10CategoryId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetCategoryIdInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getCategoryId>>>
export type GetCategoryIdInfiniteQueryError = ErrorType<void>
export type GetApiV10CategoryIdInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10CategoryId>>>
export type GetApiV10CategoryIdInfiniteQueryError = ErrorType<void>
export function useGetCategoryIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getCategoryId>>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getCategoryId>>, TError, TData>> & Pick<
export function useGetApiV10CategoryIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10CategoryId>>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10CategoryId>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getCategoryId>>,
Awaited<ReturnType<typeof getApiV10CategoryId>>,
TError,
Awaited<ReturnType<typeof getCategoryId>>
Awaited<ReturnType<typeof getApiV10CategoryId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetCategoryIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getCategoryId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getCategoryId>>, TError, TData>> & Pick<
export function useGetApiV10CategoryIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10CategoryId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10CategoryId>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getCategoryId>>,
Awaited<ReturnType<typeof getApiV10CategoryId>>,
TError,
Awaited<ReturnType<typeof getCategoryId>>
Awaited<ReturnType<typeof getApiV10CategoryId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetCategoryIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getCategoryId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getCategoryId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10CategoryIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10CategoryId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10CategoryId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get category by ID
*/
export function useGetCategoryIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getCategoryId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getCategoryId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10CategoryIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10CategoryId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10CategoryId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetCategoryIdInfiniteQueryOptions(id,options)
const queryOptions = getGetApiV10CategoryIdInfiniteQueryOptions(id,options)
const query = useInfiniteQuery(queryOptions, queryClient) as UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -174,12 +174,12 @@ export function useGetCategoryIdInfinite<TData = InfiniteData<Awaited<ReturnType
/**
* @summary Get category by ID
*/
export const prefetchGetCategoryIdInfiniteQuery = async <TData = Awaited<ReturnType<typeof getCategoryId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getCategoryId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10CategoryIdInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10CategoryId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10CategoryId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetCategoryIdInfiniteQueryOptions(id,options)
const queryOptions = getGetApiV10CategoryIdInfiniteQueryOptions(id,options)
await queryClient.prefetchInfiniteQuery(queryOptions);
......@@ -188,62 +188,62 @@ export const prefetchGetCategoryIdInfiniteQuery = async <TData = Awaited<ReturnT
export const getGetCategoryIdQueryOptions = <TData = Awaited<ReturnType<typeof getCategoryId>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCategoryId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10CategoryIdQueryOptions = <TData = Awaited<ReturnType<typeof getApiV10CategoryId>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10CategoryId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetCategoryIdQueryKey(id);
const queryKey = queryOptions?.queryKey ?? getGetApiV10CategoryIdQueryKey(id);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getCategoryId>>> = ({ signal }) => getCategoryId(id, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10CategoryId>>> = ({ signal }) => getApiV10CategoryId(id, { signal, ...requestOptions });
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getCategoryId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApiV10CategoryId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetCategoryIdQueryResult = NonNullable<Awaited<ReturnType<typeof getCategoryId>>>
export type GetCategoryIdQueryError = ErrorType<void>
export type GetApiV10CategoryIdQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10CategoryId>>>
export type GetApiV10CategoryIdQueryError = ErrorType<void>
export function useGetCategoryId<TData = Awaited<ReturnType<typeof getCategoryId>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCategoryId>>, TError, TData>> & Pick<
export function useGetApiV10CategoryId<TData = Awaited<ReturnType<typeof getApiV10CategoryId>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10CategoryId>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getCategoryId>>,
Awaited<ReturnType<typeof getApiV10CategoryId>>,
TError,
Awaited<ReturnType<typeof getCategoryId>>
Awaited<ReturnType<typeof getApiV10CategoryId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetCategoryId<TData = Awaited<ReturnType<typeof getCategoryId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCategoryId>>, TError, TData>> & Pick<
export function useGetApiV10CategoryId<TData = Awaited<ReturnType<typeof getApiV10CategoryId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10CategoryId>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getCategoryId>>,
Awaited<ReturnType<typeof getApiV10CategoryId>>,
TError,
Awaited<ReturnType<typeof getCategoryId>>
Awaited<ReturnType<typeof getApiV10CategoryId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetCategoryId<TData = Awaited<ReturnType<typeof getCategoryId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCategoryId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10CategoryId<TData = Awaited<ReturnType<typeof getApiV10CategoryId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10CategoryId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get category by ID
*/
export function useGetCategoryId<TData = Awaited<ReturnType<typeof getCategoryId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCategoryId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10CategoryId<TData = Awaited<ReturnType<typeof getApiV10CategoryId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10CategoryId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetCategoryIdQueryOptions(id,options)
const queryOptions = getGetApiV10CategoryIdQueryOptions(id,options)
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -255,12 +255,12 @@ export function useGetCategoryId<TData = Awaited<ReturnType<typeof getCategoryId
/**
* @summary Get category by ID
*/
export const prefetchGetCategoryIdQuery = async <TData = Awaited<ReturnType<typeof getCategoryId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCategoryId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10CategoryIdQuery = async <TData = Awaited<ReturnType<typeof getApiV10CategoryId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10CategoryId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetCategoryIdQueryOptions(id,options)
const queryOptions = getGetApiV10CategoryIdQueryOptions(id,options)
await queryClient.prefetchQuery(queryOptions);
......@@ -273,37 +273,37 @@ export const prefetchGetCategoryIdQuery = async <TData = Awaited<ReturnType<type
* Update a single category record by its ID
* @summary Update category by ID
*/
export type putCategoryIdResponse200 = {
data: PutCategoryId200
export type putApiV10CategoryIdResponse200 = {
data: PutApiV10CategoryId200
status: 200
}
export type putCategoryIdResponse404 = {
export type putApiV10CategoryIdResponse404 = {
data: void
status: 404
}
export type putCategoryIdResponseSuccess = (putCategoryIdResponse200) & {
export type putApiV10CategoryIdResponseSuccess = (putApiV10CategoryIdResponse200) & {
headers: Headers;
};
export type putCategoryIdResponseError = (putCategoryIdResponse404) & {
export type putApiV10CategoryIdResponseError = (putApiV10CategoryIdResponse404) & {
headers: Headers;
};
export type putCategoryIdResponse = (putCategoryIdResponseSuccess | putCategoryIdResponseError)
export type putApiV10CategoryIdResponse = (putApiV10CategoryIdResponseSuccess | putApiV10CategoryIdResponseError)
export const getPutCategoryIdUrl = (id: string,) => {
export const getPutApiV10CategoryIdUrl = (id: string,) => {
return `/category/${id}`
return `/api/v1.0/category/${id}`
}
export const putCategoryId = async (id: string,
categoryMutate: CategoryMutate, options?: RequestInit): Promise<putCategoryIdResponse> => {
export const putApiV10CategoryId = async (id: string,
categoryMutate: CategoryMutate, options?: RequestInit): Promise<putApiV10CategoryIdResponse> => {
return useCustomClient<putCategoryIdResponse>(getPutCategoryIdUrl(id),
return useCustomClient<putApiV10CategoryIdResponse>(getPutApiV10CategoryIdUrl(id),
{
...options,
method: 'PUT',
......@@ -316,11 +316,11 @@ export const putCategoryId = async (id: string,
export const getPutCategoryIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putCategoryId>>, TError,{id: string;data: BodyType<CategoryMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof putCategoryId>>, TError,{id: string;data: BodyType<CategoryMutate>}, TContext> => {
export const getPutApiV10CategoryIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putApiV10CategoryId>>, TError,{id: string;data: BodyType<CategoryMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof putApiV10CategoryId>>, TError,{id: string;data: BodyType<CategoryMutate>}, TContext> => {
const mutationKey = ['putCategoryId'];
const mutationKey = ['putApiV10CategoryId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -330,10 +330,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof putCategoryId>>, {id: string;data: BodyType<CategoryMutate>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof putApiV10CategoryId>>, {id: string;data: BodyType<CategoryMutate>}> = (props) => {
const {id,data} = props ?? {};
return putCategoryId(id,data,requestOptions)
return putApiV10CategoryId(id,data,requestOptions)
}
......@@ -341,23 +341,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PutCategoryIdMutationResult = NonNullable<Awaited<ReturnType<typeof putCategoryId>>>
export type PutCategoryIdMutationBody = BodyType<CategoryMutate>
export type PutCategoryIdMutationError = ErrorType<void>
export type PutApiV10CategoryIdMutationResult = NonNullable<Awaited<ReturnType<typeof putApiV10CategoryId>>>
export type PutApiV10CategoryIdMutationBody = BodyType<CategoryMutate>
export type PutApiV10CategoryIdMutationError = ErrorType<void>
/**
* @summary Update category by ID
*/
export const usePutCategoryId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putCategoryId>>, TError,{id: string;data: BodyType<CategoryMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePutApiV10CategoryId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putApiV10CategoryId>>, TError,{id: string;data: BodyType<CategoryMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof putCategoryId>>,
Awaited<ReturnType<typeof putApiV10CategoryId>>,
TError,
{id: string;data: BodyType<CategoryMutate>},
TContext
> => {
const mutationOptions = getPutCategoryIdMutationOptions(options);
const mutationOptions = getPutApiV10CategoryIdMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
......@@ -365,36 +365,36 @@ export const usePutCategoryId = <TError = ErrorType<void>,
* Delete a single category record by its ID
* @summary Delete category by ID
*/
export type deleteCategoryIdResponse200 = {
data: DeleteCategoryId200
export type deleteApiV10CategoryIdResponse200 = {
data: DeleteApiV10CategoryId200
status: 200
}
export type deleteCategoryIdResponse404 = {
export type deleteApiV10CategoryIdResponse404 = {
data: void
status: 404
}
export type deleteCategoryIdResponseSuccess = (deleteCategoryIdResponse200) & {
export type deleteApiV10CategoryIdResponseSuccess = (deleteApiV10CategoryIdResponse200) & {
headers: Headers;
};
export type deleteCategoryIdResponseError = (deleteCategoryIdResponse404) & {
export type deleteApiV10CategoryIdResponseError = (deleteApiV10CategoryIdResponse404) & {
headers: Headers;
};
export type deleteCategoryIdResponse = (deleteCategoryIdResponseSuccess | deleteCategoryIdResponseError)
export type deleteApiV10CategoryIdResponse = (deleteApiV10CategoryIdResponseSuccess | deleteApiV10CategoryIdResponseError)
export const getDeleteCategoryIdUrl = (id: string,) => {
export const getDeleteApiV10CategoryIdUrl = (id: string,) => {
return `/category/${id}`
return `/api/v1.0/category/${id}`
}
export const deleteCategoryId = async (id: string, options?: RequestInit): Promise<deleteCategoryIdResponse> => {
export const deleteApiV10CategoryId = async (id: string, options?: RequestInit): Promise<deleteApiV10CategoryIdResponse> => {
return useCustomClient<deleteCategoryIdResponse>(getDeleteCategoryIdUrl(id),
return useCustomClient<deleteApiV10CategoryIdResponse>(getDeleteApiV10CategoryIdUrl(id),
{
...options,
method: 'DELETE'
......@@ -406,11 +406,11 @@ export const deleteCategoryId = async (id: string, options?: RequestInit): Promi
export const getDeleteCategoryIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteCategoryId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof deleteCategoryId>>, TError,{id: string}, TContext> => {
export const getDeleteApiV10CategoryIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10CategoryId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10CategoryId>>, TError,{id: string}, TContext> => {
const mutationKey = ['deleteCategoryId'];
const mutationKey = ['deleteApiV10CategoryId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -420,10 +420,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteCategoryId>>, {id: string}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteApiV10CategoryId>>, {id: string}> = (props) => {
const {id} = props ?? {};
return deleteCategoryId(id,requestOptions)
return deleteApiV10CategoryId(id,requestOptions)
}
......@@ -431,23 +431,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type DeleteCategoryIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteCategoryId>>>
export type DeleteApiV10CategoryIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteApiV10CategoryId>>>
export type DeleteCategoryIdMutationError = ErrorType<void>
export type DeleteApiV10CategoryIdMutationError = ErrorType<void>
/**
* @summary Delete category by ID
*/
export const useDeleteCategoryId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteCategoryId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const useDeleteApiV10CategoryId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10CategoryId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof deleteCategoryId>>,
Awaited<ReturnType<typeof deleteApiV10CategoryId>>,
TError,
{id: string},
TContext
> => {
const mutationOptions = getDeleteCategoryIdMutationOptions(options);
const mutationOptions = getDeleteApiV10CategoryIdMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
......@@ -455,19 +455,19 @@ export const useDeleteCategoryId = <TError = ErrorType<void>,
* Retrieve a list of category with pagination, filtering and sorting
* @summary Get all category
*/
export type getCategoryResponse200 = {
export type getApiV10CategoryResponse200 = {
data: ResponseGetAllData
status: 200
}
export type getCategoryResponseSuccess = (getCategoryResponse200) & {
export type getApiV10CategoryResponseSuccess = (getApiV10CategoryResponse200) & {
headers: Headers;
};
;
export type getCategoryResponse = (getCategoryResponseSuccess)
export type getApiV10CategoryResponse = (getApiV10CategoryResponseSuccess)
export const getGetCategoryUrl = (params?: GetCategoryParams,) => {
export const getGetApiV10CategoryUrl = (params?: GetApiV10CategoryParams,) => {
const normalizedParams = new URLSearchParams();
Object.entries(params || {}).forEach(([key, value]) => {
......@@ -479,12 +479,12 @@ export const getGetCategoryUrl = (params?: GetCategoryParams,) => {
const stringifiedParams = normalizedParams.toString();
return stringifiedParams.length > 0 ? `/category?${stringifiedParams}` : `/category`
return stringifiedParams.length > 0 ? `/api/v1.0/category?${stringifiedParams}` : `/api/v1.0/category`
}
export const getCategory = async (params?: GetCategoryParams, options?: RequestInit): Promise<getCategoryResponse> => {
export const getApiV10Category = async (params?: GetApiV10CategoryParams, options?: RequestInit): Promise<getApiV10CategoryResponse> => {
return useCustomClient<getCategoryResponse>(getGetCategoryUrl(params),
return useCustomClient<getApiV10CategoryResponse>(getGetApiV10CategoryUrl(params),
{
...options,
method: 'GET'
......@@ -497,75 +497,75 @@ export const getCategory = async (params?: GetCategoryParams, options?: RequestI
export const getGetCategoryInfiniteQueryKey = (params?: GetCategoryParams,) => {
export const getGetApiV10CategoryInfiniteQueryKey = (params?: GetApiV10CategoryParams,) => {
return [
'infinite', `/category`, ...(params ? [params]: [])
'infinite', `/api/v1.0/category`, ...(params ? [params]: [])
] as const;
}
export const getGetCategoryQueryKey = (params?: GetCategoryParams,) => {
export const getGetApiV10CategoryQueryKey = (params?: GetApiV10CategoryParams,) => {
return [
`/category`, ...(params ? [params]: [])
`/api/v1.0/category`, ...(params ? [params]: [])
] as const;
}
export const getGetCategoryInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getCategory>>>, TError = ErrorType<unknown>>(params?: GetCategoryParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getCategory>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10CategoryInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Category>>>, TError = ErrorType<unknown>>(params?: GetApiV10CategoryParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Category>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetCategoryInfiniteQueryKey(params);
const queryKey = queryOptions?.queryKey ?? getGetApiV10CategoryInfiniteQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getCategory>>> = ({ signal }) => getCategory(params, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10Category>>> = ({ signal }) => getApiV10Category(params, { signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getCategory>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Category>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetCategoryInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getCategory>>>
export type GetCategoryInfiniteQueryError = ErrorType<unknown>
export type GetApiV10CategoryInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10Category>>>
export type GetApiV10CategoryInfiniteQueryError = ErrorType<unknown>
export function useGetCategoryInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getCategory>>>, TError = ErrorType<unknown>>(
params: undefined | GetCategoryParams, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getCategory>>, TError, TData>> & Pick<
export function useGetApiV10CategoryInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Category>>>, TError = ErrorType<unknown>>(
params: undefined | GetApiV10CategoryParams, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Category>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getCategory>>,
Awaited<ReturnType<typeof getApiV10Category>>,
TError,
Awaited<ReturnType<typeof getCategory>>
Awaited<ReturnType<typeof getApiV10Category>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetCategoryInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getCategory>>>, TError = ErrorType<unknown>>(
params?: GetCategoryParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getCategory>>, TError, TData>> & Pick<
export function useGetApiV10CategoryInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Category>>>, TError = ErrorType<unknown>>(
params?: GetApiV10CategoryParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Category>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getCategory>>,
Awaited<ReturnType<typeof getApiV10Category>>,
TError,
Awaited<ReturnType<typeof getCategory>>
Awaited<ReturnType<typeof getApiV10Category>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetCategoryInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getCategory>>>, TError = ErrorType<unknown>>(
params?: GetCategoryParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getCategory>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10CategoryInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Category>>>, TError = ErrorType<unknown>>(
params?: GetApiV10CategoryParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Category>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get all category
*/
export function useGetCategoryInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getCategory>>>, TError = ErrorType<unknown>>(
params?: GetCategoryParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getCategory>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10CategoryInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Category>>>, TError = ErrorType<unknown>>(
params?: GetApiV10CategoryParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Category>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetCategoryInfiniteQueryOptions(params,options)
const queryOptions = getGetApiV10CategoryInfiniteQueryOptions(params,options)
const query = useInfiniteQuery(queryOptions, queryClient) as UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -577,12 +577,12 @@ export function useGetCategoryInfinite<TData = InfiniteData<Awaited<ReturnType<t
/**
* @summary Get all category
*/
export const prefetchGetCategoryInfiniteQuery = async <TData = Awaited<ReturnType<typeof getCategory>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetCategoryParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getCategory>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10CategoryInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10Category>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetApiV10CategoryParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Category>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetCategoryInfiniteQueryOptions(params,options)
const queryOptions = getGetApiV10CategoryInfiniteQueryOptions(params,options)
await queryClient.prefetchInfiniteQuery(queryOptions);
......@@ -591,62 +591,62 @@ export const prefetchGetCategoryInfiniteQuery = async <TData = Awaited<ReturnTyp
export const getGetCategoryQueryOptions = <TData = Awaited<ReturnType<typeof getCategory>>, TError = ErrorType<unknown>>(params?: GetCategoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCategory>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10CategoryQueryOptions = <TData = Awaited<ReturnType<typeof getApiV10Category>>, TError = ErrorType<unknown>>(params?: GetApiV10CategoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Category>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetCategoryQueryKey(params);
const queryKey = queryOptions?.queryKey ?? getGetApiV10CategoryQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getCategory>>> = ({ signal }) => getCategory(params, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10Category>>> = ({ signal }) => getApiV10Category(params, { signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getCategory>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApiV10Category>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetCategoryQueryResult = NonNullable<Awaited<ReturnType<typeof getCategory>>>
export type GetCategoryQueryError = ErrorType<unknown>
export type GetApiV10CategoryQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10Category>>>
export type GetApiV10CategoryQueryError = ErrorType<unknown>
export function useGetCategory<TData = Awaited<ReturnType<typeof getCategory>>, TError = ErrorType<unknown>>(
params: undefined | GetCategoryParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCategory>>, TError, TData>> & Pick<
export function useGetApiV10Category<TData = Awaited<ReturnType<typeof getApiV10Category>>, TError = ErrorType<unknown>>(
params: undefined | GetApiV10CategoryParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Category>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getCategory>>,
Awaited<ReturnType<typeof getApiV10Category>>,
TError,
Awaited<ReturnType<typeof getCategory>>
Awaited<ReturnType<typeof getApiV10Category>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetCategory<TData = Awaited<ReturnType<typeof getCategory>>, TError = ErrorType<unknown>>(
params?: GetCategoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCategory>>, TError, TData>> & Pick<
export function useGetApiV10Category<TData = Awaited<ReturnType<typeof getApiV10Category>>, TError = ErrorType<unknown>>(
params?: GetApiV10CategoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Category>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getCategory>>,
Awaited<ReturnType<typeof getApiV10Category>>,
TError,
Awaited<ReturnType<typeof getCategory>>
Awaited<ReturnType<typeof getApiV10Category>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetCategory<TData = Awaited<ReturnType<typeof getCategory>>, TError = ErrorType<unknown>>(
params?: GetCategoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCategory>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10Category<TData = Awaited<ReturnType<typeof getApiV10Category>>, TError = ErrorType<unknown>>(
params?: GetApiV10CategoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Category>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get all category
*/
export function useGetCategory<TData = Awaited<ReturnType<typeof getCategory>>, TError = ErrorType<unknown>>(
params?: GetCategoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCategory>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10Category<TData = Awaited<ReturnType<typeof getApiV10Category>>, TError = ErrorType<unknown>>(
params?: GetApiV10CategoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Category>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetCategoryQueryOptions(params,options)
const queryOptions = getGetApiV10CategoryQueryOptions(params,options)
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -658,12 +658,12 @@ export function useGetCategory<TData = Awaited<ReturnType<typeof getCategory>>,
/**
* @summary Get all category
*/
export const prefetchGetCategoryQuery = async <TData = Awaited<ReturnType<typeof getCategory>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetCategoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCategory>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10CategoryQuery = async <TData = Awaited<ReturnType<typeof getApiV10Category>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetApiV10CategoryParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Category>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetCategoryQueryOptions(params,options)
const queryOptions = getGetApiV10CategoryQueryOptions(params,options)
await queryClient.prefetchQuery(queryOptions);
......@@ -676,29 +676,29 @@ export const prefetchGetCategoryQuery = async <TData = Awaited<ReturnType<typeof
* Create a new category record
* @summary Create a category
*/
export type postCategoryResponse200 = {
data: PostCategory200
export type postApiV10CategoryResponse200 = {
data: PostApiV10Category200
status: 200
}
export type postCategoryResponseSuccess = (postCategoryResponse200) & {
export type postApiV10CategoryResponseSuccess = (postApiV10CategoryResponse200) & {
headers: Headers;
};
;
export type postCategoryResponse = (postCategoryResponseSuccess)
export type postApiV10CategoryResponse = (postApiV10CategoryResponseSuccess)
export const getPostCategoryUrl = () => {
export const getPostApiV10CategoryUrl = () => {
return `/category`
return `/api/v1.0/category`
}
export const postCategory = async (categoryMutate: CategoryMutate, options?: RequestInit): Promise<postCategoryResponse> => {
export const postApiV10Category = async (categoryMutate: CategoryMutate, options?: RequestInit): Promise<postApiV10CategoryResponse> => {
return useCustomClient<postCategoryResponse>(getPostCategoryUrl(),
return useCustomClient<postApiV10CategoryResponse>(getPostApiV10CategoryUrl(),
{
...options,
method: 'POST',
......@@ -711,11 +711,11 @@ export const postCategory = async (categoryMutate: CategoryMutate, options?: Req
export const getPostCategoryMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postCategory>>, TError,{data: BodyType<CategoryMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postCategory>>, TError,{data: BodyType<CategoryMutate>}, TContext> => {
export const getPostApiV10CategoryMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postApiV10Category>>, TError,{data: BodyType<CategoryMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postApiV10Category>>, TError,{data: BodyType<CategoryMutate>}, TContext> => {
const mutationKey = ['postCategory'];
const mutationKey = ['postApiV10Category'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -725,10 +725,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof postCategory>>, {data: BodyType<CategoryMutate>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof postApiV10Category>>, {data: BodyType<CategoryMutate>}> = (props) => {
const {data} = props ?? {};
return postCategory(data,requestOptions)
return postApiV10Category(data,requestOptions)
}
......@@ -736,23 +736,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PostCategoryMutationResult = NonNullable<Awaited<ReturnType<typeof postCategory>>>
export type PostCategoryMutationBody = BodyType<CategoryMutate>
export type PostCategoryMutationError = ErrorType<unknown>
export type PostApiV10CategoryMutationResult = NonNullable<Awaited<ReturnType<typeof postApiV10Category>>>
export type PostApiV10CategoryMutationBody = BodyType<CategoryMutate>
export type PostApiV10CategoryMutationError = ErrorType<unknown>
/**
* @summary Create a category
*/
export const usePostCategory = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postCategory>>, TError,{data: BodyType<CategoryMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePostApiV10Category = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postApiV10Category>>, TError,{data: BodyType<CategoryMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof postCategory>>,
Awaited<ReturnType<typeof postApiV10Category>>,
TError,
{data: BodyType<CategoryMutate>},
TContext
> => {
const mutationOptions = getPostCategoryMutationOptions(options);
const mutationOptions = getPostApiV10CategoryMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import {
......@@ -31,11 +31,11 @@ import type {
import type {
ContactMutate,
DeleteContactId200,
GetContactId200,
GetContactParams,
PostContact200,
PutContactId200,
DeleteApiV10ContactId200,
GetApiV10ContactId200,
GetApiV10ContactParams,
PostApiV10Contact200,
PutApiV10ContactId200,
ResponseGetAllData
} from '../models';
......@@ -52,36 +52,36 @@ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
* Retrieve a single contact record by its ID
* @summary Get contact by ID
*/
export type getContactIdResponse200 = {
data: GetContactId200
export type getApiV10ContactIdResponse200 = {
data: GetApiV10ContactId200
status: 200
}
export type getContactIdResponse404 = {
export type getApiV10ContactIdResponse404 = {
data: void
status: 404
}
export type getContactIdResponseSuccess = (getContactIdResponse200) & {
export type getApiV10ContactIdResponseSuccess = (getApiV10ContactIdResponse200) & {
headers: Headers;
};
export type getContactIdResponseError = (getContactIdResponse404) & {
export type getApiV10ContactIdResponseError = (getApiV10ContactIdResponse404) & {
headers: Headers;
};
export type getContactIdResponse = (getContactIdResponseSuccess | getContactIdResponseError)
export type getApiV10ContactIdResponse = (getApiV10ContactIdResponseSuccess | getApiV10ContactIdResponseError)
export const getGetContactIdUrl = (id: string,) => {
export const getGetApiV10ContactIdUrl = (id: string,) => {
return `/contact/${id}`
return `/api/v1.0/contact/${id}`
}
export const getContactId = async (id: string, options?: RequestInit): Promise<getContactIdResponse> => {
export const getApiV10ContactId = async (id: string, options?: RequestInit): Promise<getApiV10ContactIdResponse> => {
return useCustomClient<getContactIdResponse>(getGetContactIdUrl(id),
return useCustomClient<getApiV10ContactIdResponse>(getGetApiV10ContactIdUrl(id),
{
...options,
method: 'GET'
......@@ -94,75 +94,75 @@ export const getContactId = async (id: string, options?: RequestInit): Promise<g
export const getGetContactIdInfiniteQueryKey = (id?: string,) => {
export const getGetApiV10ContactIdInfiniteQueryKey = (id?: string,) => {
return [
'infinite', `/contact/${id}`
'infinite', `/api/v1.0/contact/${id}`
] as const;
}
export const getGetContactIdQueryKey = (id?: string,) => {
export const getGetApiV10ContactIdQueryKey = (id?: string,) => {
return [
`/contact/${id}`
`/api/v1.0/contact/${id}`
] as const;
}
export const getGetContactIdInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getContactId>>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getContactId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10ContactIdInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getApiV10ContactId>>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetContactIdInfiniteQueryKey(id);
const queryKey = queryOptions?.queryKey ?? getGetApiV10ContactIdInfiniteQueryKey(id);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getContactId>>> = ({ signal }) => getContactId(id, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10ContactId>>> = ({ signal }) => getApiV10ContactId(id, { signal, ...requestOptions });
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getContactId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetContactIdInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getContactId>>>
export type GetContactIdInfiniteQueryError = ErrorType<void>
export type GetApiV10ContactIdInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10ContactId>>>
export type GetApiV10ContactIdInfiniteQueryError = ErrorType<void>
export function useGetContactIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getContactId>>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getContactId>>, TError, TData>> & Pick<
export function useGetApiV10ContactIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10ContactId>>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getContactId>>,
Awaited<ReturnType<typeof getApiV10ContactId>>,
TError,
Awaited<ReturnType<typeof getContactId>>
Awaited<ReturnType<typeof getApiV10ContactId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetContactIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getContactId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getContactId>>, TError, TData>> & Pick<
export function useGetApiV10ContactIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10ContactId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getContactId>>,
Awaited<ReturnType<typeof getApiV10ContactId>>,
TError,
Awaited<ReturnType<typeof getContactId>>
Awaited<ReturnType<typeof getApiV10ContactId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetContactIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getContactId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getContactId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10ContactIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10ContactId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get contact by ID
*/
export function useGetContactIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getContactId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getContactId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10ContactIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10ContactId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetContactIdInfiniteQueryOptions(id,options)
const queryOptions = getGetApiV10ContactIdInfiniteQueryOptions(id,options)
const query = useInfiniteQuery(queryOptions, queryClient) as UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -174,12 +174,12 @@ export function useGetContactIdInfinite<TData = InfiniteData<Awaited<ReturnType<
/**
* @summary Get contact by ID
*/
export const prefetchGetContactIdInfiniteQuery = async <TData = Awaited<ReturnType<typeof getContactId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getContactId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10ContactIdInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10ContactId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetContactIdInfiniteQueryOptions(id,options)
const queryOptions = getGetApiV10ContactIdInfiniteQueryOptions(id,options)
await queryClient.prefetchInfiniteQuery(queryOptions);
......@@ -188,62 +188,62 @@ export const prefetchGetContactIdInfiniteQuery = async <TData = Awaited<ReturnTy
export const getGetContactIdQueryOptions = <TData = Awaited<ReturnType<typeof getContactId>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getContactId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10ContactIdQueryOptions = <TData = Awaited<ReturnType<typeof getApiV10ContactId>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetContactIdQueryKey(id);
const queryKey = queryOptions?.queryKey ?? getGetApiV10ContactIdQueryKey(id);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getContactId>>> = ({ signal }) => getContactId(id, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10ContactId>>> = ({ signal }) => getApiV10ContactId(id, { signal, ...requestOptions });
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getContactId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetContactIdQueryResult = NonNullable<Awaited<ReturnType<typeof getContactId>>>
export type GetContactIdQueryError = ErrorType<void>
export type GetApiV10ContactIdQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10ContactId>>>
export type GetApiV10ContactIdQueryError = ErrorType<void>
export function useGetContactId<TData = Awaited<ReturnType<typeof getContactId>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getContactId>>, TError, TData>> & Pick<
export function useGetApiV10ContactId<TData = Awaited<ReturnType<typeof getApiV10ContactId>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getContactId>>,
Awaited<ReturnType<typeof getApiV10ContactId>>,
TError,
Awaited<ReturnType<typeof getContactId>>
Awaited<ReturnType<typeof getApiV10ContactId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetContactId<TData = Awaited<ReturnType<typeof getContactId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getContactId>>, TError, TData>> & Pick<
export function useGetApiV10ContactId<TData = Awaited<ReturnType<typeof getApiV10ContactId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getContactId>>,
Awaited<ReturnType<typeof getApiV10ContactId>>,
TError,
Awaited<ReturnType<typeof getContactId>>
Awaited<ReturnType<typeof getApiV10ContactId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetContactId<TData = Awaited<ReturnType<typeof getContactId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getContactId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10ContactId<TData = Awaited<ReturnType<typeof getApiV10ContactId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get contact by ID
*/
export function useGetContactId<TData = Awaited<ReturnType<typeof getContactId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getContactId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10ContactId<TData = Awaited<ReturnType<typeof getApiV10ContactId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetContactIdQueryOptions(id,options)
const queryOptions = getGetApiV10ContactIdQueryOptions(id,options)
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -255,12 +255,12 @@ export function useGetContactId<TData = Awaited<ReturnType<typeof getContactId>>
/**
* @summary Get contact by ID
*/
export const prefetchGetContactIdQuery = async <TData = Awaited<ReturnType<typeof getContactId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getContactId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10ContactIdQuery = async <TData = Awaited<ReturnType<typeof getApiV10ContactId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10ContactId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetContactIdQueryOptions(id,options)
const queryOptions = getGetApiV10ContactIdQueryOptions(id,options)
await queryClient.prefetchQuery(queryOptions);
......@@ -273,37 +273,37 @@ export const prefetchGetContactIdQuery = async <TData = Awaited<ReturnType<typeo
* Update a single contact record by its ID
* @summary Update contact by ID
*/
export type putContactIdResponse200 = {
data: PutContactId200
export type putApiV10ContactIdResponse200 = {
data: PutApiV10ContactId200
status: 200
}
export type putContactIdResponse404 = {
export type putApiV10ContactIdResponse404 = {
data: void
status: 404
}
export type putContactIdResponseSuccess = (putContactIdResponse200) & {
export type putApiV10ContactIdResponseSuccess = (putApiV10ContactIdResponse200) & {
headers: Headers;
};
export type putContactIdResponseError = (putContactIdResponse404) & {
export type putApiV10ContactIdResponseError = (putApiV10ContactIdResponse404) & {
headers: Headers;
};
export type putContactIdResponse = (putContactIdResponseSuccess | putContactIdResponseError)
export type putApiV10ContactIdResponse = (putApiV10ContactIdResponseSuccess | putApiV10ContactIdResponseError)
export const getPutContactIdUrl = (id: string,) => {
export const getPutApiV10ContactIdUrl = (id: string,) => {
return `/contact/${id}`
return `/api/v1.0/contact/${id}`
}
export const putContactId = async (id: string,
contactMutate: ContactMutate, options?: RequestInit): Promise<putContactIdResponse> => {
export const putApiV10ContactId = async (id: string,
contactMutate: ContactMutate, options?: RequestInit): Promise<putApiV10ContactIdResponse> => {
return useCustomClient<putContactIdResponse>(getPutContactIdUrl(id),
return useCustomClient<putApiV10ContactIdResponse>(getPutApiV10ContactIdUrl(id),
{
...options,
method: 'PUT',
......@@ -316,11 +316,11 @@ export const putContactId = async (id: string,
export const getPutContactIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putContactId>>, TError,{id: string;data: BodyType<ContactMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof putContactId>>, TError,{id: string;data: BodyType<ContactMutate>}, TContext> => {
export const getPutApiV10ContactIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putApiV10ContactId>>, TError,{id: string;data: BodyType<ContactMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof putApiV10ContactId>>, TError,{id: string;data: BodyType<ContactMutate>}, TContext> => {
const mutationKey = ['putContactId'];
const mutationKey = ['putApiV10ContactId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -330,10 +330,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof putContactId>>, {id: string;data: BodyType<ContactMutate>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof putApiV10ContactId>>, {id: string;data: BodyType<ContactMutate>}> = (props) => {
const {id,data} = props ?? {};
return putContactId(id,data,requestOptions)
return putApiV10ContactId(id,data,requestOptions)
}
......@@ -341,23 +341,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PutContactIdMutationResult = NonNullable<Awaited<ReturnType<typeof putContactId>>>
export type PutContactIdMutationBody = BodyType<ContactMutate>
export type PutContactIdMutationError = ErrorType<void>
export type PutApiV10ContactIdMutationResult = NonNullable<Awaited<ReturnType<typeof putApiV10ContactId>>>
export type PutApiV10ContactIdMutationBody = BodyType<ContactMutate>
export type PutApiV10ContactIdMutationError = ErrorType<void>
/**
* @summary Update contact by ID
*/
export const usePutContactId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putContactId>>, TError,{id: string;data: BodyType<ContactMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePutApiV10ContactId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putApiV10ContactId>>, TError,{id: string;data: BodyType<ContactMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof putContactId>>,
Awaited<ReturnType<typeof putApiV10ContactId>>,
TError,
{id: string;data: BodyType<ContactMutate>},
TContext
> => {
const mutationOptions = getPutContactIdMutationOptions(options);
const mutationOptions = getPutApiV10ContactIdMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
......@@ -365,36 +365,36 @@ export const usePutContactId = <TError = ErrorType<void>,
* Delete a single contact record by its ID
* @summary Delete contact by ID
*/
export type deleteContactIdResponse200 = {
data: DeleteContactId200
export type deleteApiV10ContactIdResponse200 = {
data: DeleteApiV10ContactId200
status: 200
}
export type deleteContactIdResponse404 = {
export type deleteApiV10ContactIdResponse404 = {
data: void
status: 404
}
export type deleteContactIdResponseSuccess = (deleteContactIdResponse200) & {
export type deleteApiV10ContactIdResponseSuccess = (deleteApiV10ContactIdResponse200) & {
headers: Headers;
};
export type deleteContactIdResponseError = (deleteContactIdResponse404) & {
export type deleteApiV10ContactIdResponseError = (deleteApiV10ContactIdResponse404) & {
headers: Headers;
};
export type deleteContactIdResponse = (deleteContactIdResponseSuccess | deleteContactIdResponseError)
export type deleteApiV10ContactIdResponse = (deleteApiV10ContactIdResponseSuccess | deleteApiV10ContactIdResponseError)
export const getDeleteContactIdUrl = (id: string,) => {
export const getDeleteApiV10ContactIdUrl = (id: string,) => {
return `/contact/${id}`
return `/api/v1.0/contact/${id}`
}
export const deleteContactId = async (id: string, options?: RequestInit): Promise<deleteContactIdResponse> => {
export const deleteApiV10ContactId = async (id: string, options?: RequestInit): Promise<deleteApiV10ContactIdResponse> => {
return useCustomClient<deleteContactIdResponse>(getDeleteContactIdUrl(id),
return useCustomClient<deleteApiV10ContactIdResponse>(getDeleteApiV10ContactIdUrl(id),
{
...options,
method: 'DELETE'
......@@ -406,11 +406,11 @@ export const deleteContactId = async (id: string, options?: RequestInit): Promis
export const getDeleteContactIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteContactId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof deleteContactId>>, TError,{id: string}, TContext> => {
export const getDeleteApiV10ContactIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10ContactId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10ContactId>>, TError,{id: string}, TContext> => {
const mutationKey = ['deleteContactId'];
const mutationKey = ['deleteApiV10ContactId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -420,10 +420,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteContactId>>, {id: string}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteApiV10ContactId>>, {id: string}> = (props) => {
const {id} = props ?? {};
return deleteContactId(id,requestOptions)
return deleteApiV10ContactId(id,requestOptions)
}
......@@ -431,23 +431,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type DeleteContactIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteContactId>>>
export type DeleteApiV10ContactIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteApiV10ContactId>>>
export type DeleteContactIdMutationError = ErrorType<void>
export type DeleteApiV10ContactIdMutationError = ErrorType<void>
/**
* @summary Delete contact by ID
*/
export const useDeleteContactId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteContactId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const useDeleteApiV10ContactId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10ContactId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof deleteContactId>>,
Awaited<ReturnType<typeof deleteApiV10ContactId>>,
TError,
{id: string},
TContext
> => {
const mutationOptions = getDeleteContactIdMutationOptions(options);
const mutationOptions = getDeleteApiV10ContactIdMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
......@@ -455,19 +455,19 @@ export const useDeleteContactId = <TError = ErrorType<void>,
* Retrieve a list of contact with pagination, filtering and sorting
* @summary Get all contact
*/
export type getContactResponse200 = {
export type getApiV10ContactResponse200 = {
data: ResponseGetAllData
status: 200
}
export type getContactResponseSuccess = (getContactResponse200) & {
export type getApiV10ContactResponseSuccess = (getApiV10ContactResponse200) & {
headers: Headers;
};
;
export type getContactResponse = (getContactResponseSuccess)
export type getApiV10ContactResponse = (getApiV10ContactResponseSuccess)
export const getGetContactUrl = (params?: GetContactParams,) => {
export const getGetApiV10ContactUrl = (params?: GetApiV10ContactParams,) => {
const normalizedParams = new URLSearchParams();
Object.entries(params || {}).forEach(([key, value]) => {
......@@ -479,12 +479,12 @@ export const getGetContactUrl = (params?: GetContactParams,) => {
const stringifiedParams = normalizedParams.toString();
return stringifiedParams.length > 0 ? `/contact?${stringifiedParams}` : `/contact`
return stringifiedParams.length > 0 ? `/api/v1.0/contact?${stringifiedParams}` : `/api/v1.0/contact`
}
export const getContact = async (params?: GetContactParams, options?: RequestInit): Promise<getContactResponse> => {
export const getApiV10Contact = async (params?: GetApiV10ContactParams, options?: RequestInit): Promise<getApiV10ContactResponse> => {
return useCustomClient<getContactResponse>(getGetContactUrl(params),
return useCustomClient<getApiV10ContactResponse>(getGetApiV10ContactUrl(params),
{
...options,
method: 'GET'
......@@ -497,75 +497,75 @@ export const getContact = async (params?: GetContactParams, options?: RequestIni
export const getGetContactInfiniteQueryKey = (params?: GetContactParams,) => {
export const getGetApiV10ContactInfiniteQueryKey = (params?: GetApiV10ContactParams,) => {
return [
'infinite', `/contact`, ...(params ? [params]: [])
'infinite', `/api/v1.0/contact`, ...(params ? [params]: [])
] as const;
}
export const getGetContactQueryKey = (params?: GetContactParams,) => {
export const getGetApiV10ContactQueryKey = (params?: GetApiV10ContactParams,) => {
return [
`/contact`, ...(params ? [params]: [])
`/api/v1.0/contact`, ...(params ? [params]: [])
] as const;
}
export const getGetContactInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getContact>>>, TError = ErrorType<unknown>>(params?: GetContactParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getContact>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10ContactInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Contact>>>, TError = ErrorType<unknown>>(params?: GetApiV10ContactParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetContactInfiniteQueryKey(params);
const queryKey = queryOptions?.queryKey ?? getGetApiV10ContactInfiniteQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getContact>>> = ({ signal }) => getContact(params, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10Contact>>> = ({ signal }) => getApiV10Contact(params, { signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getContact>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetContactInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getContact>>>
export type GetContactInfiniteQueryError = ErrorType<unknown>
export type GetApiV10ContactInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10Contact>>>
export type GetApiV10ContactInfiniteQueryError = ErrorType<unknown>
export function useGetContactInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getContact>>>, TError = ErrorType<unknown>>(
params: undefined | GetContactParams, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getContact>>, TError, TData>> & Pick<
export function useGetApiV10ContactInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Contact>>>, TError = ErrorType<unknown>>(
params: undefined | GetApiV10ContactParams, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getContact>>,
Awaited<ReturnType<typeof getApiV10Contact>>,
TError,
Awaited<ReturnType<typeof getContact>>
Awaited<ReturnType<typeof getApiV10Contact>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetContactInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getContact>>>, TError = ErrorType<unknown>>(
params?: GetContactParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getContact>>, TError, TData>> & Pick<
export function useGetApiV10ContactInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Contact>>>, TError = ErrorType<unknown>>(
params?: GetApiV10ContactParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getContact>>,
Awaited<ReturnType<typeof getApiV10Contact>>,
TError,
Awaited<ReturnType<typeof getContact>>
Awaited<ReturnType<typeof getApiV10Contact>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetContactInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getContact>>>, TError = ErrorType<unknown>>(
params?: GetContactParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getContact>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10ContactInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Contact>>>, TError = ErrorType<unknown>>(
params?: GetApiV10ContactParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get all contact
*/
export function useGetContactInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getContact>>>, TError = ErrorType<unknown>>(
params?: GetContactParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getContact>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10ContactInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Contact>>>, TError = ErrorType<unknown>>(
params?: GetApiV10ContactParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetContactInfiniteQueryOptions(params,options)
const queryOptions = getGetApiV10ContactInfiniteQueryOptions(params,options)
const query = useInfiniteQuery(queryOptions, queryClient) as UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -577,12 +577,12 @@ export function useGetContactInfinite<TData = InfiniteData<Awaited<ReturnType<ty
/**
* @summary Get all contact
*/
export const prefetchGetContactInfiniteQuery = async <TData = Awaited<ReturnType<typeof getContact>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetContactParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getContact>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10ContactInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10Contact>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetApiV10ContactParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetContactInfiniteQueryOptions(params,options)
const queryOptions = getGetApiV10ContactInfiniteQueryOptions(params,options)
await queryClient.prefetchInfiniteQuery(queryOptions);
......@@ -591,62 +591,62 @@ export const prefetchGetContactInfiniteQuery = async <TData = Awaited<ReturnType
export const getGetContactQueryOptions = <TData = Awaited<ReturnType<typeof getContact>>, TError = ErrorType<unknown>>(params?: GetContactParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getContact>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10ContactQueryOptions = <TData = Awaited<ReturnType<typeof getApiV10Contact>>, TError = ErrorType<unknown>>(params?: GetApiV10ContactParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetContactQueryKey(params);
const queryKey = queryOptions?.queryKey ?? getGetApiV10ContactQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getContact>>> = ({ signal }) => getContact(params, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10Contact>>> = ({ signal }) => getApiV10Contact(params, { signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getContact>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetContactQueryResult = NonNullable<Awaited<ReturnType<typeof getContact>>>
export type GetContactQueryError = ErrorType<unknown>
export type GetApiV10ContactQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10Contact>>>
export type GetApiV10ContactQueryError = ErrorType<unknown>
export function useGetContact<TData = Awaited<ReturnType<typeof getContact>>, TError = ErrorType<unknown>>(
params: undefined | GetContactParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getContact>>, TError, TData>> & Pick<
export function useGetApiV10Contact<TData = Awaited<ReturnType<typeof getApiV10Contact>>, TError = ErrorType<unknown>>(
params: undefined | GetApiV10ContactParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getContact>>,
Awaited<ReturnType<typeof getApiV10Contact>>,
TError,
Awaited<ReturnType<typeof getContact>>
Awaited<ReturnType<typeof getApiV10Contact>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetContact<TData = Awaited<ReturnType<typeof getContact>>, TError = ErrorType<unknown>>(
params?: GetContactParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getContact>>, TError, TData>> & Pick<
export function useGetApiV10Contact<TData = Awaited<ReturnType<typeof getApiV10Contact>>, TError = ErrorType<unknown>>(
params?: GetApiV10ContactParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getContact>>,
Awaited<ReturnType<typeof getApiV10Contact>>,
TError,
Awaited<ReturnType<typeof getContact>>
Awaited<ReturnType<typeof getApiV10Contact>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetContact<TData = Awaited<ReturnType<typeof getContact>>, TError = ErrorType<unknown>>(
params?: GetContactParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getContact>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10Contact<TData = Awaited<ReturnType<typeof getApiV10Contact>>, TError = ErrorType<unknown>>(
params?: GetApiV10ContactParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get all contact
*/
export function useGetContact<TData = Awaited<ReturnType<typeof getContact>>, TError = ErrorType<unknown>>(
params?: GetContactParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getContact>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10Contact<TData = Awaited<ReturnType<typeof getApiV10Contact>>, TError = ErrorType<unknown>>(
params?: GetApiV10ContactParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetContactQueryOptions(params,options)
const queryOptions = getGetApiV10ContactQueryOptions(params,options)
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -658,12 +658,12 @@ export function useGetContact<TData = Awaited<ReturnType<typeof getContact>>, TE
/**
* @summary Get all contact
*/
export const prefetchGetContactQuery = async <TData = Awaited<ReturnType<typeof getContact>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetContactParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getContact>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10ContactQuery = async <TData = Awaited<ReturnType<typeof getApiV10Contact>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetApiV10ContactParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Contact>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetContactQueryOptions(params,options)
const queryOptions = getGetApiV10ContactQueryOptions(params,options)
await queryClient.prefetchQuery(queryOptions);
......@@ -676,29 +676,29 @@ export const prefetchGetContactQuery = async <TData = Awaited<ReturnType<typeof
* Create a new contact record
* @summary Create a contact
*/
export type postContactResponse200 = {
data: PostContact200
export type postApiV10ContactResponse200 = {
data: PostApiV10Contact200
status: 200
}
export type postContactResponseSuccess = (postContactResponse200) & {
export type postApiV10ContactResponseSuccess = (postApiV10ContactResponse200) & {
headers: Headers;
};
;
export type postContactResponse = (postContactResponseSuccess)
export type postApiV10ContactResponse = (postApiV10ContactResponseSuccess)
export const getPostContactUrl = () => {
export const getPostApiV10ContactUrl = () => {
return `/contact`
return `/api/v1.0/contact`
}
export const postContact = async (contactMutate: ContactMutate, options?: RequestInit): Promise<postContactResponse> => {
export const postApiV10Contact = async (contactMutate: ContactMutate, options?: RequestInit): Promise<postApiV10ContactResponse> => {
return useCustomClient<postContactResponse>(getPostContactUrl(),
return useCustomClient<postApiV10ContactResponse>(getPostApiV10ContactUrl(),
{
...options,
method: 'POST',
......@@ -711,11 +711,11 @@ export const postContact = async (contactMutate: ContactMutate, options?: Reques
export const getPostContactMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postContact>>, TError,{data: BodyType<ContactMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postContact>>, TError,{data: BodyType<ContactMutate>}, TContext> => {
export const getPostApiV10ContactMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postApiV10Contact>>, TError,{data: BodyType<ContactMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postApiV10Contact>>, TError,{data: BodyType<ContactMutate>}, TContext> => {
const mutationKey = ['postContact'];
const mutationKey = ['postApiV10Contact'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -725,10 +725,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof postContact>>, {data: BodyType<ContactMutate>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof postApiV10Contact>>, {data: BodyType<ContactMutate>}> = (props) => {
const {data} = props ?? {};
return postContact(data,requestOptions)
return postApiV10Contact(data,requestOptions)
}
......@@ -736,23 +736,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PostContactMutationResult = NonNullable<Awaited<ReturnType<typeof postContact>>>
export type PostContactMutationBody = BodyType<ContactMutate>
export type PostContactMutationError = ErrorType<unknown>
export type PostApiV10ContactMutationResult = NonNullable<Awaited<ReturnType<typeof postApiV10Contact>>>
export type PostApiV10ContactMutationBody = BodyType<ContactMutate>
export type PostApiV10ContactMutationError = ErrorType<unknown>
/**
* @summary Create a contact
*/
export const usePostContact = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postContact>>, TError,{data: BodyType<ContactMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePostApiV10Contact = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postApiV10Contact>>, TError,{data: BodyType<ContactMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof postContact>>,
Awaited<ReturnType<typeof postApiV10Contact>>,
TError,
{data: BodyType<ContactMutate>},
TContext
> => {
const mutationOptions = getPostContactMutationOptions(options);
const mutationOptions = getPostApiV10ContactMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import {
......@@ -30,13 +30,13 @@ import type {
} from '@tanstack/react-query';
import type {
DeleteLogoId200,
GetLogoId200,
GetLogoParams,
DeleteApiV10LogoId200,
GetApiV10LogoId200,
GetApiV10LogoParams,
LogoCreate,
LogoUpdate,
PostLogo200,
PutLogoId200,
PostApiV10Logo200,
PutApiV10LogoId200,
ResponseGetAllData
} from '../models';
......@@ -53,36 +53,36 @@ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
* Retrieve a single logo record by its ID
* @summary Get logo by ID
*/
export type getLogoIdResponse200 = {
data: GetLogoId200
export type getApiV10LogoIdResponse200 = {
data: GetApiV10LogoId200
status: 200
}
export type getLogoIdResponse404 = {
export type getApiV10LogoIdResponse404 = {
data: void
status: 404
}
export type getLogoIdResponseSuccess = (getLogoIdResponse200) & {
export type getApiV10LogoIdResponseSuccess = (getApiV10LogoIdResponse200) & {
headers: Headers;
};
export type getLogoIdResponseError = (getLogoIdResponse404) & {
export type getApiV10LogoIdResponseError = (getApiV10LogoIdResponse404) & {
headers: Headers;
};
export type getLogoIdResponse = (getLogoIdResponseSuccess | getLogoIdResponseError)
export type getApiV10LogoIdResponse = (getApiV10LogoIdResponseSuccess | getApiV10LogoIdResponseError)
export const getGetLogoIdUrl = (id: string,) => {
export const getGetApiV10LogoIdUrl = (id: string,) => {
return `/logo/${id}`
return `/api/v1.0/logo/${id}`
}
export const getLogoId = async (id: string, options?: RequestInit): Promise<getLogoIdResponse> => {
export const getApiV10LogoId = async (id: string, options?: RequestInit): Promise<getApiV10LogoIdResponse> => {
return useCustomClient<getLogoIdResponse>(getGetLogoIdUrl(id),
return useCustomClient<getApiV10LogoIdResponse>(getGetApiV10LogoIdUrl(id),
{
...options,
method: 'GET'
......@@ -95,75 +95,75 @@ export const getLogoId = async (id: string, options?: RequestInit): Promise<getL
export const getGetLogoIdInfiniteQueryKey = (id?: string,) => {
export const getGetApiV10LogoIdInfiniteQueryKey = (id?: string,) => {
return [
'infinite', `/logo/${id}`
'infinite', `/api/v1.0/logo/${id}`
] as const;
}
export const getGetLogoIdQueryKey = (id?: string,) => {
export const getGetApiV10LogoIdQueryKey = (id?: string,) => {
return [
`/logo/${id}`
`/api/v1.0/logo/${id}`
] as const;
}
export const getGetLogoIdInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getLogoId>>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getLogoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10LogoIdInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getApiV10LogoId>>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10LogoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetLogoIdInfiniteQueryKey(id);
const queryKey = queryOptions?.queryKey ?? getGetApiV10LogoIdInfiniteQueryKey(id);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getLogoId>>> = ({ signal }) => getLogoId(id, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10LogoId>>> = ({ signal }) => getApiV10LogoId(id, { signal, ...requestOptions });
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getLogoId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10LogoId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetLogoIdInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getLogoId>>>
export type GetLogoIdInfiniteQueryError = ErrorType<void>
export type GetApiV10LogoIdInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10LogoId>>>
export type GetApiV10LogoIdInfiniteQueryError = ErrorType<void>
export function useGetLogoIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getLogoId>>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getLogoId>>, TError, TData>> & Pick<
export function useGetApiV10LogoIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10LogoId>>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10LogoId>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getLogoId>>,
Awaited<ReturnType<typeof getApiV10LogoId>>,
TError,
Awaited<ReturnType<typeof getLogoId>>
Awaited<ReturnType<typeof getApiV10LogoId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetLogoIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getLogoId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getLogoId>>, TError, TData>> & Pick<
export function useGetApiV10LogoIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10LogoId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10LogoId>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getLogoId>>,
Awaited<ReturnType<typeof getApiV10LogoId>>,
TError,
Awaited<ReturnType<typeof getLogoId>>
Awaited<ReturnType<typeof getApiV10LogoId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetLogoIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getLogoId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getLogoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10LogoIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10LogoId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10LogoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get logo by ID
*/
export function useGetLogoIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getLogoId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getLogoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10LogoIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10LogoId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10LogoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetLogoIdInfiniteQueryOptions(id,options)
const queryOptions = getGetApiV10LogoIdInfiniteQueryOptions(id,options)
const query = useInfiniteQuery(queryOptions, queryClient) as UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -175,12 +175,12 @@ export function useGetLogoIdInfinite<TData = InfiniteData<Awaited<ReturnType<typ
/**
* @summary Get logo by ID
*/
export const prefetchGetLogoIdInfiniteQuery = async <TData = Awaited<ReturnType<typeof getLogoId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getLogoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10LogoIdInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10LogoId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10LogoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetLogoIdInfiniteQueryOptions(id,options)
const queryOptions = getGetApiV10LogoIdInfiniteQueryOptions(id,options)
await queryClient.prefetchInfiniteQuery(queryOptions);
......@@ -189,62 +189,62 @@ export const prefetchGetLogoIdInfiniteQuery = async <TData = Awaited<ReturnType<
export const getGetLogoIdQueryOptions = <TData = Awaited<ReturnType<typeof getLogoId>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getLogoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10LogoIdQueryOptions = <TData = Awaited<ReturnType<typeof getApiV10LogoId>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10LogoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetLogoIdQueryKey(id);
const queryKey = queryOptions?.queryKey ?? getGetApiV10LogoIdQueryKey(id);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getLogoId>>> = ({ signal }) => getLogoId(id, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10LogoId>>> = ({ signal }) => getApiV10LogoId(id, { signal, ...requestOptions });
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getLogoId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApiV10LogoId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetLogoIdQueryResult = NonNullable<Awaited<ReturnType<typeof getLogoId>>>
export type GetLogoIdQueryError = ErrorType<void>
export type GetApiV10LogoIdQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10LogoId>>>
export type GetApiV10LogoIdQueryError = ErrorType<void>
export function useGetLogoId<TData = Awaited<ReturnType<typeof getLogoId>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getLogoId>>, TError, TData>> & Pick<
export function useGetApiV10LogoId<TData = Awaited<ReturnType<typeof getApiV10LogoId>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10LogoId>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getLogoId>>,
Awaited<ReturnType<typeof getApiV10LogoId>>,
TError,
Awaited<ReturnType<typeof getLogoId>>
Awaited<ReturnType<typeof getApiV10LogoId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetLogoId<TData = Awaited<ReturnType<typeof getLogoId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getLogoId>>, TError, TData>> & Pick<
export function useGetApiV10LogoId<TData = Awaited<ReturnType<typeof getApiV10LogoId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10LogoId>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getLogoId>>,
Awaited<ReturnType<typeof getApiV10LogoId>>,
TError,
Awaited<ReturnType<typeof getLogoId>>
Awaited<ReturnType<typeof getApiV10LogoId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetLogoId<TData = Awaited<ReturnType<typeof getLogoId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getLogoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10LogoId<TData = Awaited<ReturnType<typeof getApiV10LogoId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10LogoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get logo by ID
*/
export function useGetLogoId<TData = Awaited<ReturnType<typeof getLogoId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getLogoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10LogoId<TData = Awaited<ReturnType<typeof getApiV10LogoId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10LogoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetLogoIdQueryOptions(id,options)
const queryOptions = getGetApiV10LogoIdQueryOptions(id,options)
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -256,12 +256,12 @@ export function useGetLogoId<TData = Awaited<ReturnType<typeof getLogoId>>, TErr
/**
* @summary Get logo by ID
*/
export const prefetchGetLogoIdQuery = async <TData = Awaited<ReturnType<typeof getLogoId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getLogoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10LogoIdQuery = async <TData = Awaited<ReturnType<typeof getApiV10LogoId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10LogoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetLogoIdQueryOptions(id,options)
const queryOptions = getGetApiV10LogoIdQueryOptions(id,options)
await queryClient.prefetchQuery(queryOptions);
......@@ -274,47 +274,47 @@ export const prefetchGetLogoIdQuery = async <TData = Awaited<ReturnType<typeof g
* Update a single logo record by its ID
* @summary Update logo by ID
*/
export type putLogoIdResponse200 = {
data: PutLogoId200
export type putApiV10LogoIdResponse200 = {
data: PutApiV10LogoId200
status: 200
}
export type putLogoIdResponse400 = {
export type putApiV10LogoIdResponse400 = {
data: void
status: 400
}
export type putLogoIdResponse404 = {
export type putApiV10LogoIdResponse404 = {
data: void
status: 404
}
export type putLogoIdResponse409 = {
export type putApiV10LogoIdResponse409 = {
data: void
status: 409
}
export type putLogoIdResponseSuccess = (putLogoIdResponse200) & {
export type putApiV10LogoIdResponseSuccess = (putApiV10LogoIdResponse200) & {
headers: Headers;
};
export type putLogoIdResponseError = (putLogoIdResponse400 | putLogoIdResponse404 | putLogoIdResponse409) & {
export type putApiV10LogoIdResponseError = (putApiV10LogoIdResponse400 | putApiV10LogoIdResponse404 | putApiV10LogoIdResponse409) & {
headers: Headers;
};
export type putLogoIdResponse = (putLogoIdResponseSuccess | putLogoIdResponseError)
export type putApiV10LogoIdResponse = (putApiV10LogoIdResponseSuccess | putApiV10LogoIdResponseError)
export const getPutLogoIdUrl = (id: string,) => {
export const getPutApiV10LogoIdUrl = (id: string,) => {
return `/logo/${id}`
return `/api/v1.0/logo/${id}`
}
export const putLogoId = async (id: string,
logoUpdate: LogoUpdate, options?: RequestInit): Promise<putLogoIdResponse> => {
export const putApiV10LogoId = async (id: string,
logoUpdate: LogoUpdate, options?: RequestInit): Promise<putApiV10LogoIdResponse> => {
return useCustomClient<putLogoIdResponse>(getPutLogoIdUrl(id),
return useCustomClient<putApiV10LogoIdResponse>(getPutApiV10LogoIdUrl(id),
{
...options,
method: 'PUT',
......@@ -327,11 +327,11 @@ export const putLogoId = async (id: string,
export const getPutLogoIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putLogoId>>, TError,{id: string;data: BodyType<LogoUpdate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof putLogoId>>, TError,{id: string;data: BodyType<LogoUpdate>}, TContext> => {
export const getPutApiV10LogoIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putApiV10LogoId>>, TError,{id: string;data: BodyType<LogoUpdate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof putApiV10LogoId>>, TError,{id: string;data: BodyType<LogoUpdate>}, TContext> => {
const mutationKey = ['putLogoId'];
const mutationKey = ['putApiV10LogoId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -341,10 +341,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof putLogoId>>, {id: string;data: BodyType<LogoUpdate>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof putApiV10LogoId>>, {id: string;data: BodyType<LogoUpdate>}> = (props) => {
const {id,data} = props ?? {};
return putLogoId(id,data,requestOptions)
return putApiV10LogoId(id,data,requestOptions)
}
......@@ -352,23 +352,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PutLogoIdMutationResult = NonNullable<Awaited<ReturnType<typeof putLogoId>>>
export type PutLogoIdMutationBody = BodyType<LogoUpdate>
export type PutLogoIdMutationError = ErrorType<void>
export type PutApiV10LogoIdMutationResult = NonNullable<Awaited<ReturnType<typeof putApiV10LogoId>>>
export type PutApiV10LogoIdMutationBody = BodyType<LogoUpdate>
export type PutApiV10LogoIdMutationError = ErrorType<void>
/**
* @summary Update logo by ID
*/
export const usePutLogoId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putLogoId>>, TError,{id: string;data: BodyType<LogoUpdate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePutApiV10LogoId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putApiV10LogoId>>, TError,{id: string;data: BodyType<LogoUpdate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof putLogoId>>,
Awaited<ReturnType<typeof putApiV10LogoId>>,
TError,
{id: string;data: BodyType<LogoUpdate>},
TContext
> => {
const mutationOptions = getPutLogoIdMutationOptions(options);
const mutationOptions = getPutApiV10LogoIdMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
......@@ -376,41 +376,41 @@ export const usePutLogoId = <TError = ErrorType<void>,
* Delete a single logo record by its ID
* @summary Delete logo by ID
*/
export type deleteLogoIdResponse200 = {
data: DeleteLogoId200
export type deleteApiV10LogoIdResponse200 = {
data: DeleteApiV10LogoId200
status: 200
}
export type deleteLogoIdResponse404 = {
export type deleteApiV10LogoIdResponse404 = {
data: void
status: 404
}
export type deleteLogoIdResponse409 = {
export type deleteApiV10LogoIdResponse409 = {
data: void
status: 409
}
export type deleteLogoIdResponseSuccess = (deleteLogoIdResponse200) & {
export type deleteApiV10LogoIdResponseSuccess = (deleteApiV10LogoIdResponse200) & {
headers: Headers;
};
export type deleteLogoIdResponseError = (deleteLogoIdResponse404 | deleteLogoIdResponse409) & {
export type deleteApiV10LogoIdResponseError = (deleteApiV10LogoIdResponse404 | deleteApiV10LogoIdResponse409) & {
headers: Headers;
};
export type deleteLogoIdResponse = (deleteLogoIdResponseSuccess | deleteLogoIdResponseError)
export type deleteApiV10LogoIdResponse = (deleteApiV10LogoIdResponseSuccess | deleteApiV10LogoIdResponseError)
export const getDeleteLogoIdUrl = (id: string,) => {
export const getDeleteApiV10LogoIdUrl = (id: string,) => {
return `/logo/${id}`
return `/api/v1.0/logo/${id}`
}
export const deleteLogoId = async (id: string, options?: RequestInit): Promise<deleteLogoIdResponse> => {
export const deleteApiV10LogoId = async (id: string, options?: RequestInit): Promise<deleteApiV10LogoIdResponse> => {
return useCustomClient<deleteLogoIdResponse>(getDeleteLogoIdUrl(id),
return useCustomClient<deleteApiV10LogoIdResponse>(getDeleteApiV10LogoIdUrl(id),
{
...options,
method: 'DELETE'
......@@ -422,11 +422,11 @@ export const deleteLogoId = async (id: string, options?: RequestInit): Promise<d
export const getDeleteLogoIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteLogoId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof deleteLogoId>>, TError,{id: string}, TContext> => {
export const getDeleteApiV10LogoIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10LogoId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10LogoId>>, TError,{id: string}, TContext> => {
const mutationKey = ['deleteLogoId'];
const mutationKey = ['deleteApiV10LogoId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -436,10 +436,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteLogoId>>, {id: string}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteApiV10LogoId>>, {id: string}> = (props) => {
const {id} = props ?? {};
return deleteLogoId(id,requestOptions)
return deleteApiV10LogoId(id,requestOptions)
}
......@@ -447,23 +447,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type DeleteLogoIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteLogoId>>>
export type DeleteApiV10LogoIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteApiV10LogoId>>>
export type DeleteLogoIdMutationError = ErrorType<void>
export type DeleteApiV10LogoIdMutationError = ErrorType<void>
/**
* @summary Delete logo by ID
*/
export const useDeleteLogoId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteLogoId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const useDeleteApiV10LogoId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10LogoId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof deleteLogoId>>,
Awaited<ReturnType<typeof deleteApiV10LogoId>>,
TError,
{id: string},
TContext
> => {
const mutationOptions = getDeleteLogoIdMutationOptions(options);
const mutationOptions = getDeleteApiV10LogoIdMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
......@@ -471,19 +471,19 @@ export const useDeleteLogoId = <TError = ErrorType<void>,
* Retrieve a list of logos with pagination, filtering and sorting
* @summary Get all logos
*/
export type getLogoResponse200 = {
export type getApiV10LogoResponse200 = {
data: ResponseGetAllData
status: 200
}
export type getLogoResponseSuccess = (getLogoResponse200) & {
export type getApiV10LogoResponseSuccess = (getApiV10LogoResponse200) & {
headers: Headers;
};
;
export type getLogoResponse = (getLogoResponseSuccess)
export type getApiV10LogoResponse = (getApiV10LogoResponseSuccess)
export const getGetLogoUrl = (params?: GetLogoParams,) => {
export const getGetApiV10LogoUrl = (params?: GetApiV10LogoParams,) => {
const normalizedParams = new URLSearchParams();
Object.entries(params || {}).forEach(([key, value]) => {
......@@ -495,12 +495,12 @@ export const getGetLogoUrl = (params?: GetLogoParams,) => {
const stringifiedParams = normalizedParams.toString();
return stringifiedParams.length > 0 ? `/logo?${stringifiedParams}` : `/logo`
return stringifiedParams.length > 0 ? `/api/v1.0/logo?${stringifiedParams}` : `/api/v1.0/logo`
}
export const getLogo = async (params?: GetLogoParams, options?: RequestInit): Promise<getLogoResponse> => {
export const getApiV10Logo = async (params?: GetApiV10LogoParams, options?: RequestInit): Promise<getApiV10LogoResponse> => {
return useCustomClient<getLogoResponse>(getGetLogoUrl(params),
return useCustomClient<getApiV10LogoResponse>(getGetApiV10LogoUrl(params),
{
...options,
method: 'GET'
......@@ -513,75 +513,75 @@ export const getLogo = async (params?: GetLogoParams, options?: RequestInit): Pr
export const getGetLogoInfiniteQueryKey = (params?: GetLogoParams,) => {
export const getGetApiV10LogoInfiniteQueryKey = (params?: GetApiV10LogoParams,) => {
return [
'infinite', `/logo`, ...(params ? [params]: [])
'infinite', `/api/v1.0/logo`, ...(params ? [params]: [])
] as const;
}
export const getGetLogoQueryKey = (params?: GetLogoParams,) => {
export const getGetApiV10LogoQueryKey = (params?: GetApiV10LogoParams,) => {
return [
`/logo`, ...(params ? [params]: [])
`/api/v1.0/logo`, ...(params ? [params]: [])
] as const;
}
export const getGetLogoInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getLogo>>>, TError = ErrorType<unknown>>(params?: GetLogoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getLogo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10LogoInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Logo>>>, TError = ErrorType<unknown>>(params?: GetApiV10LogoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Logo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetLogoInfiniteQueryKey(params);
const queryKey = queryOptions?.queryKey ?? getGetApiV10LogoInfiniteQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getLogo>>> = ({ signal }) => getLogo(params, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10Logo>>> = ({ signal }) => getApiV10Logo(params, { signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getLogo>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Logo>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetLogoInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getLogo>>>
export type GetLogoInfiniteQueryError = ErrorType<unknown>
export type GetApiV10LogoInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10Logo>>>
export type GetApiV10LogoInfiniteQueryError = ErrorType<unknown>
export function useGetLogoInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getLogo>>>, TError = ErrorType<unknown>>(
params: undefined | GetLogoParams, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getLogo>>, TError, TData>> & Pick<
export function useGetApiV10LogoInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Logo>>>, TError = ErrorType<unknown>>(
params: undefined | GetApiV10LogoParams, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Logo>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getLogo>>,
Awaited<ReturnType<typeof getApiV10Logo>>,
TError,
Awaited<ReturnType<typeof getLogo>>
Awaited<ReturnType<typeof getApiV10Logo>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetLogoInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getLogo>>>, TError = ErrorType<unknown>>(
params?: GetLogoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getLogo>>, TError, TData>> & Pick<
export function useGetApiV10LogoInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Logo>>>, TError = ErrorType<unknown>>(
params?: GetApiV10LogoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Logo>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getLogo>>,
Awaited<ReturnType<typeof getApiV10Logo>>,
TError,
Awaited<ReturnType<typeof getLogo>>
Awaited<ReturnType<typeof getApiV10Logo>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetLogoInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getLogo>>>, TError = ErrorType<unknown>>(
params?: GetLogoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getLogo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10LogoInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Logo>>>, TError = ErrorType<unknown>>(
params?: GetApiV10LogoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Logo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get all logos
*/
export function useGetLogoInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getLogo>>>, TError = ErrorType<unknown>>(
params?: GetLogoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getLogo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10LogoInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Logo>>>, TError = ErrorType<unknown>>(
params?: GetApiV10LogoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Logo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetLogoInfiniteQueryOptions(params,options)
const queryOptions = getGetApiV10LogoInfiniteQueryOptions(params,options)
const query = useInfiniteQuery(queryOptions, queryClient) as UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -593,12 +593,12 @@ export function useGetLogoInfinite<TData = InfiniteData<Awaited<ReturnType<typeo
/**
* @summary Get all logos
*/
export const prefetchGetLogoInfiniteQuery = async <TData = Awaited<ReturnType<typeof getLogo>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetLogoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getLogo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10LogoInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10Logo>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetApiV10LogoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Logo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetLogoInfiniteQueryOptions(params,options)
const queryOptions = getGetApiV10LogoInfiniteQueryOptions(params,options)
await queryClient.prefetchInfiniteQuery(queryOptions);
......@@ -607,62 +607,62 @@ export const prefetchGetLogoInfiniteQuery = async <TData = Awaited<ReturnType<ty
export const getGetLogoQueryOptions = <TData = Awaited<ReturnType<typeof getLogo>>, TError = ErrorType<unknown>>(params?: GetLogoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getLogo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10LogoQueryOptions = <TData = Awaited<ReturnType<typeof getApiV10Logo>>, TError = ErrorType<unknown>>(params?: GetApiV10LogoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Logo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetLogoQueryKey(params);
const queryKey = queryOptions?.queryKey ?? getGetApiV10LogoQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getLogo>>> = ({ signal }) => getLogo(params, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10Logo>>> = ({ signal }) => getApiV10Logo(params, { signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getLogo>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApiV10Logo>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetLogoQueryResult = NonNullable<Awaited<ReturnType<typeof getLogo>>>
export type GetLogoQueryError = ErrorType<unknown>
export type GetApiV10LogoQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10Logo>>>
export type GetApiV10LogoQueryError = ErrorType<unknown>
export function useGetLogo<TData = Awaited<ReturnType<typeof getLogo>>, TError = ErrorType<unknown>>(
params: undefined | GetLogoParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getLogo>>, TError, TData>> & Pick<
export function useGetApiV10Logo<TData = Awaited<ReturnType<typeof getApiV10Logo>>, TError = ErrorType<unknown>>(
params: undefined | GetApiV10LogoParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Logo>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getLogo>>,
Awaited<ReturnType<typeof getApiV10Logo>>,
TError,
Awaited<ReturnType<typeof getLogo>>
Awaited<ReturnType<typeof getApiV10Logo>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetLogo<TData = Awaited<ReturnType<typeof getLogo>>, TError = ErrorType<unknown>>(
params?: GetLogoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getLogo>>, TError, TData>> & Pick<
export function useGetApiV10Logo<TData = Awaited<ReturnType<typeof getApiV10Logo>>, TError = ErrorType<unknown>>(
params?: GetApiV10LogoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Logo>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getLogo>>,
Awaited<ReturnType<typeof getApiV10Logo>>,
TError,
Awaited<ReturnType<typeof getLogo>>
Awaited<ReturnType<typeof getApiV10Logo>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetLogo<TData = Awaited<ReturnType<typeof getLogo>>, TError = ErrorType<unknown>>(
params?: GetLogoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getLogo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10Logo<TData = Awaited<ReturnType<typeof getApiV10Logo>>, TError = ErrorType<unknown>>(
params?: GetApiV10LogoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Logo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get all logos
*/
export function useGetLogo<TData = Awaited<ReturnType<typeof getLogo>>, TError = ErrorType<unknown>>(
params?: GetLogoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getLogo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10Logo<TData = Awaited<ReturnType<typeof getApiV10Logo>>, TError = ErrorType<unknown>>(
params?: GetApiV10LogoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Logo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetLogoQueryOptions(params,options)
const queryOptions = getGetApiV10LogoQueryOptions(params,options)
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -674,12 +674,12 @@ export function useGetLogo<TData = Awaited<ReturnType<typeof getLogo>>, TError =
/**
* @summary Get all logos
*/
export const prefetchGetLogoQuery = async <TData = Awaited<ReturnType<typeof getLogo>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetLogoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getLogo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10LogoQuery = async <TData = Awaited<ReturnType<typeof getApiV10Logo>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetApiV10LogoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Logo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetLogoQueryOptions(params,options)
const queryOptions = getGetApiV10LogoQueryOptions(params,options)
await queryClient.prefetchQuery(queryOptions);
......@@ -692,46 +692,46 @@ export const prefetchGetLogoQuery = async <TData = Awaited<ReturnType<typeof get
* Create a new logo record
* @summary Create a logo
*/
export type postLogoResponse200 = {
data: PostLogo200
export type postApiV10LogoResponse200 = {
data: PostApiV10Logo200
status: 200
}
export type postLogoResponse400 = {
export type postApiV10LogoResponse400 = {
data: void
status: 400
}
export type postLogoResponse404 = {
export type postApiV10LogoResponse404 = {
data: void
status: 404
}
export type postLogoResponse409 = {
export type postApiV10LogoResponse409 = {
data: void
status: 409
}
export type postLogoResponseSuccess = (postLogoResponse200) & {
export type postApiV10LogoResponseSuccess = (postApiV10LogoResponse200) & {
headers: Headers;
};
export type postLogoResponseError = (postLogoResponse400 | postLogoResponse404 | postLogoResponse409) & {
export type postApiV10LogoResponseError = (postApiV10LogoResponse400 | postApiV10LogoResponse404 | postApiV10LogoResponse409) & {
headers: Headers;
};
export type postLogoResponse = (postLogoResponseSuccess | postLogoResponseError)
export type postApiV10LogoResponse = (postApiV10LogoResponseSuccess | postApiV10LogoResponseError)
export const getPostLogoUrl = () => {
export const getPostApiV10LogoUrl = () => {
return `/logo`
return `/api/v1.0/logo`
}
export const postLogo = async (logoCreate: LogoCreate, options?: RequestInit): Promise<postLogoResponse> => {
export const postApiV10Logo = async (logoCreate: LogoCreate, options?: RequestInit): Promise<postApiV10LogoResponse> => {
return useCustomClient<postLogoResponse>(getPostLogoUrl(),
return useCustomClient<postApiV10LogoResponse>(getPostApiV10LogoUrl(),
{
...options,
method: 'POST',
......@@ -744,11 +744,11 @@ export const postLogo = async (logoCreate: LogoCreate, options?: RequestInit): P
export const getPostLogoMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postLogo>>, TError,{data: BodyType<LogoCreate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postLogo>>, TError,{data: BodyType<LogoCreate>}, TContext> => {
export const getPostApiV10LogoMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postApiV10Logo>>, TError,{data: BodyType<LogoCreate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postApiV10Logo>>, TError,{data: BodyType<LogoCreate>}, TContext> => {
const mutationKey = ['postLogo'];
const mutationKey = ['postApiV10Logo'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -758,10 +758,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof postLogo>>, {data: BodyType<LogoCreate>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof postApiV10Logo>>, {data: BodyType<LogoCreate>}> = (props) => {
const {data} = props ?? {};
return postLogo(data,requestOptions)
return postApiV10Logo(data,requestOptions)
}
......@@ -769,23 +769,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PostLogoMutationResult = NonNullable<Awaited<ReturnType<typeof postLogo>>>
export type PostLogoMutationBody = BodyType<LogoCreate>
export type PostLogoMutationError = ErrorType<void>
export type PostApiV10LogoMutationResult = NonNullable<Awaited<ReturnType<typeof postApiV10Logo>>>
export type PostApiV10LogoMutationBody = BodyType<LogoCreate>
export type PostApiV10LogoMutationError = ErrorType<void>
/**
* @summary Create a logo
*/
export const usePostLogo = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postLogo>>, TError,{data: BodyType<LogoCreate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePostApiV10Logo = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postApiV10Logo>>, TError,{data: BodyType<LogoCreate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof postLogo>>,
Awaited<ReturnType<typeof postApiV10Logo>>,
TError,
{data: BodyType<LogoCreate>},
TContext
> => {
const mutationOptions = getPostLogoMutationOptions(options);
const mutationOptions = getPostApiV10LogoMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import {
......@@ -30,11 +30,11 @@ import type {
} from '@tanstack/react-query';
import type {
GetNewsletterSubscriptionParams,
GetApiV10NewsletterSubscriptionParams,
NewsletterSubscriptionMutate,
NewsletterSubscriptionUpdate,
PatchNewsletterSubscriptionId200,
PostNewsletterSubscription200,
PatchApiV10NewsletterSubscriptionId200,
PostApiV10NewsletterSubscription200,
ResponseGetAllData
} from '../models';
......@@ -51,30 +51,30 @@ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
* Update seen status of a newsletter subscription email
* @summary Update newsletter subscription status
*/
export type patchNewsletterSubscriptionIdResponse200 = {
data: PatchNewsletterSubscriptionId200
export type patchApiV10NewsletterSubscriptionIdResponse200 = {
data: PatchApiV10NewsletterSubscriptionId200
status: 200
}
export type patchNewsletterSubscriptionIdResponseSuccess = (patchNewsletterSubscriptionIdResponse200) & {
export type patchApiV10NewsletterSubscriptionIdResponseSuccess = (patchApiV10NewsletterSubscriptionIdResponse200) & {
headers: Headers;
};
;
export type patchNewsletterSubscriptionIdResponse = (patchNewsletterSubscriptionIdResponseSuccess)
export type patchApiV10NewsletterSubscriptionIdResponse = (patchApiV10NewsletterSubscriptionIdResponseSuccess)
export const getPatchNewsletterSubscriptionIdUrl = (id: string,) => {
export const getPatchApiV10NewsletterSubscriptionIdUrl = (id: string,) => {
return `/newsletterSubscription/${id}`
return `/api/v1.0/newsletterSubscription/${id}`
}
export const patchNewsletterSubscriptionId = async (id: string,
newsletterSubscriptionUpdate: NewsletterSubscriptionUpdate, options?: RequestInit): Promise<patchNewsletterSubscriptionIdResponse> => {
export const patchApiV10NewsletterSubscriptionId = async (id: string,
newsletterSubscriptionUpdate: NewsletterSubscriptionUpdate, options?: RequestInit): Promise<patchApiV10NewsletterSubscriptionIdResponse> => {
return useCustomClient<patchNewsletterSubscriptionIdResponse>(getPatchNewsletterSubscriptionIdUrl(id),
return useCustomClient<patchApiV10NewsletterSubscriptionIdResponse>(getPatchApiV10NewsletterSubscriptionIdUrl(id),
{
...options,
method: 'PATCH',
......@@ -87,11 +87,11 @@ export const patchNewsletterSubscriptionId = async (id: string,
export const getPatchNewsletterSubscriptionIdMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchNewsletterSubscriptionId>>, TError,{id: string;data: BodyType<NewsletterSubscriptionUpdate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof patchNewsletterSubscriptionId>>, TError,{id: string;data: BodyType<NewsletterSubscriptionUpdate>}, TContext> => {
export const getPatchApiV10NewsletterSubscriptionIdMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchApiV10NewsletterSubscriptionId>>, TError,{id: string;data: BodyType<NewsletterSubscriptionUpdate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof patchApiV10NewsletterSubscriptionId>>, TError,{id: string;data: BodyType<NewsletterSubscriptionUpdate>}, TContext> => {
const mutationKey = ['patchNewsletterSubscriptionId'];
const mutationKey = ['patchApiV10NewsletterSubscriptionId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -101,10 +101,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchNewsletterSubscriptionId>>, {id: string;data: BodyType<NewsletterSubscriptionUpdate>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchApiV10NewsletterSubscriptionId>>, {id: string;data: BodyType<NewsletterSubscriptionUpdate>}> = (props) => {
const {id,data} = props ?? {};
return patchNewsletterSubscriptionId(id,data,requestOptions)
return patchApiV10NewsletterSubscriptionId(id,data,requestOptions)
}
......@@ -112,23 +112,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PatchNewsletterSubscriptionIdMutationResult = NonNullable<Awaited<ReturnType<typeof patchNewsletterSubscriptionId>>>
export type PatchNewsletterSubscriptionIdMutationBody = BodyType<NewsletterSubscriptionUpdate>
export type PatchNewsletterSubscriptionIdMutationError = ErrorType<unknown>
export type PatchApiV10NewsletterSubscriptionIdMutationResult = NonNullable<Awaited<ReturnType<typeof patchApiV10NewsletterSubscriptionId>>>
export type PatchApiV10NewsletterSubscriptionIdMutationBody = BodyType<NewsletterSubscriptionUpdate>
export type PatchApiV10NewsletterSubscriptionIdMutationError = ErrorType<unknown>
/**
* @summary Update newsletter subscription status
*/
export const usePatchNewsletterSubscriptionId = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchNewsletterSubscriptionId>>, TError,{id: string;data: BodyType<NewsletterSubscriptionUpdate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePatchApiV10NewsletterSubscriptionId = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchApiV10NewsletterSubscriptionId>>, TError,{id: string;data: BodyType<NewsletterSubscriptionUpdate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof patchNewsletterSubscriptionId>>,
Awaited<ReturnType<typeof patchApiV10NewsletterSubscriptionId>>,
TError,
{id: string;data: BodyType<NewsletterSubscriptionUpdate>},
TContext
> => {
const mutationOptions = getPatchNewsletterSubscriptionIdMutationOptions(options);
const mutationOptions = getPatchApiV10NewsletterSubscriptionIdMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
......@@ -136,29 +136,29 @@ export const usePatchNewsletterSubscriptionId = <TError = ErrorType<unknown>,
* Delete a newsletter subscription email
* @summary Delete newsletter subscription
*/
export type deleteNewsletterSubscriptionIdResponse200 = {
export type deleteApiV10NewsletterSubscriptionIdResponse200 = {
data: void
status: 200
}
export type deleteNewsletterSubscriptionIdResponseSuccess = (deleteNewsletterSubscriptionIdResponse200) & {
export type deleteApiV10NewsletterSubscriptionIdResponseSuccess = (deleteApiV10NewsletterSubscriptionIdResponse200) & {
headers: Headers;
};
;
export type deleteNewsletterSubscriptionIdResponse = (deleteNewsletterSubscriptionIdResponseSuccess)
export type deleteApiV10NewsletterSubscriptionIdResponse = (deleteApiV10NewsletterSubscriptionIdResponseSuccess)
export const getDeleteNewsletterSubscriptionIdUrl = (id: string,) => {
export const getDeleteApiV10NewsletterSubscriptionIdUrl = (id: string,) => {
return `/newsletterSubscription/${id}`
return `/api/v1.0/newsletterSubscription/${id}`
}
export const deleteNewsletterSubscriptionId = async (id: string, options?: RequestInit): Promise<deleteNewsletterSubscriptionIdResponse> => {
export const deleteApiV10NewsletterSubscriptionId = async (id: string, options?: RequestInit): Promise<deleteApiV10NewsletterSubscriptionIdResponse> => {
return useCustomClient<deleteNewsletterSubscriptionIdResponse>(getDeleteNewsletterSubscriptionIdUrl(id),
return useCustomClient<deleteApiV10NewsletterSubscriptionIdResponse>(getDeleteApiV10NewsletterSubscriptionIdUrl(id),
{
...options,
method: 'DELETE'
......@@ -170,11 +170,11 @@ export const deleteNewsletterSubscriptionId = async (id: string, options?: Reque
export const getDeleteNewsletterSubscriptionIdMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteNewsletterSubscriptionId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof deleteNewsletterSubscriptionId>>, TError,{id: string}, TContext> => {
export const getDeleteApiV10NewsletterSubscriptionIdMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10NewsletterSubscriptionId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10NewsletterSubscriptionId>>, TError,{id: string}, TContext> => {
const mutationKey = ['deleteNewsletterSubscriptionId'];
const mutationKey = ['deleteApiV10NewsletterSubscriptionId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -184,10 +184,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteNewsletterSubscriptionId>>, {id: string}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteApiV10NewsletterSubscriptionId>>, {id: string}> = (props) => {
const {id} = props ?? {};
return deleteNewsletterSubscriptionId(id,requestOptions)
return deleteApiV10NewsletterSubscriptionId(id,requestOptions)
}
......@@ -195,23 +195,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type DeleteNewsletterSubscriptionIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteNewsletterSubscriptionId>>>
export type DeleteApiV10NewsletterSubscriptionIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteApiV10NewsletterSubscriptionId>>>
export type DeleteNewsletterSubscriptionIdMutationError = ErrorType<unknown>
export type DeleteApiV10NewsletterSubscriptionIdMutationError = ErrorType<unknown>
/**
* @summary Delete newsletter subscription
*/
export const useDeleteNewsletterSubscriptionId = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteNewsletterSubscriptionId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const useDeleteApiV10NewsletterSubscriptionId = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10NewsletterSubscriptionId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof deleteNewsletterSubscriptionId>>,
Awaited<ReturnType<typeof deleteApiV10NewsletterSubscriptionId>>,
TError,
{id: string},
TContext
> => {
const mutationOptions = getDeleteNewsletterSubscriptionIdMutationOptions(options);
const mutationOptions = getDeleteApiV10NewsletterSubscriptionIdMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
......@@ -219,19 +219,19 @@ export const useDeleteNewsletterSubscriptionId = <TError = ErrorType<unknown>,
* Retrieve newsletter subscription emails with pagination, filtering and sorting
* @summary Get all newsletter subscriptions
*/
export type getNewsletterSubscriptionResponse200 = {
export type getApiV10NewsletterSubscriptionResponse200 = {
data: ResponseGetAllData
status: 200
}
export type getNewsletterSubscriptionResponseSuccess = (getNewsletterSubscriptionResponse200) & {
export type getApiV10NewsletterSubscriptionResponseSuccess = (getApiV10NewsletterSubscriptionResponse200) & {
headers: Headers;
};
;
export type getNewsletterSubscriptionResponse = (getNewsletterSubscriptionResponseSuccess)
export type getApiV10NewsletterSubscriptionResponse = (getApiV10NewsletterSubscriptionResponseSuccess)
export const getGetNewsletterSubscriptionUrl = (params?: GetNewsletterSubscriptionParams,) => {
export const getGetApiV10NewsletterSubscriptionUrl = (params?: GetApiV10NewsletterSubscriptionParams,) => {
const normalizedParams = new URLSearchParams();
Object.entries(params || {}).forEach(([key, value]) => {
......@@ -243,12 +243,12 @@ export const getGetNewsletterSubscriptionUrl = (params?: GetNewsletterSubscripti
const stringifiedParams = normalizedParams.toString();
return stringifiedParams.length > 0 ? `/newsletterSubscription?${stringifiedParams}` : `/newsletterSubscription`
return stringifiedParams.length > 0 ? `/api/v1.0/newsletterSubscription?${stringifiedParams}` : `/api/v1.0/newsletterSubscription`
}
export const getNewsletterSubscription = async (params?: GetNewsletterSubscriptionParams, options?: RequestInit): Promise<getNewsletterSubscriptionResponse> => {
export const getApiV10NewsletterSubscription = async (params?: GetApiV10NewsletterSubscriptionParams, options?: RequestInit): Promise<getApiV10NewsletterSubscriptionResponse> => {
return useCustomClient<getNewsletterSubscriptionResponse>(getGetNewsletterSubscriptionUrl(params),
return useCustomClient<getApiV10NewsletterSubscriptionResponse>(getGetApiV10NewsletterSubscriptionUrl(params),
{
...options,
method: 'GET'
......@@ -261,75 +261,75 @@ export const getNewsletterSubscription = async (params?: GetNewsletterSubscripti
export const getGetNewsletterSubscriptionInfiniteQueryKey = (params?: GetNewsletterSubscriptionParams,) => {
export const getGetApiV10NewsletterSubscriptionInfiniteQueryKey = (params?: GetApiV10NewsletterSubscriptionParams,) => {
return [
'infinite', `/newsletterSubscription`, ...(params ? [params]: [])
'infinite', `/api/v1.0/newsletterSubscription`, ...(params ? [params]: [])
] as const;
}
export const getGetNewsletterSubscriptionQueryKey = (params?: GetNewsletterSubscriptionParams,) => {
export const getGetApiV10NewsletterSubscriptionQueryKey = (params?: GetApiV10NewsletterSubscriptionParams,) => {
return [
`/newsletterSubscription`, ...(params ? [params]: [])
`/api/v1.0/newsletterSubscription`, ...(params ? [params]: [])
] as const;
}
export const getGetNewsletterSubscriptionInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getNewsletterSubscription>>>, TError = ErrorType<unknown>>(params?: GetNewsletterSubscriptionParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getNewsletterSubscription>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10NewsletterSubscriptionInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>>, TError = ErrorType<unknown>>(params?: GetApiV10NewsletterSubscriptionParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetNewsletterSubscriptionInfiniteQueryKey(params);
const queryKey = queryOptions?.queryKey ?? getGetApiV10NewsletterSubscriptionInfiniteQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getNewsletterSubscription>>> = ({ signal }) => getNewsletterSubscription(params, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>> = ({ signal }) => getApiV10NewsletterSubscription(params, { signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getNewsletterSubscription>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetNewsletterSubscriptionInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getNewsletterSubscription>>>
export type GetNewsletterSubscriptionInfiniteQueryError = ErrorType<unknown>
export type GetApiV10NewsletterSubscriptionInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>>
export type GetApiV10NewsletterSubscriptionInfiniteQueryError = ErrorType<unknown>
export function useGetNewsletterSubscriptionInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getNewsletterSubscription>>>, TError = ErrorType<unknown>>(
params: undefined | GetNewsletterSubscriptionParams, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getNewsletterSubscription>>, TError, TData>> & Pick<
export function useGetApiV10NewsletterSubscriptionInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>>, TError = ErrorType<unknown>>(
params: undefined | GetApiV10NewsletterSubscriptionParams, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getNewsletterSubscription>>,
Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>,
TError,
Awaited<ReturnType<typeof getNewsletterSubscription>>
Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetNewsletterSubscriptionInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getNewsletterSubscription>>>, TError = ErrorType<unknown>>(
params?: GetNewsletterSubscriptionParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getNewsletterSubscription>>, TError, TData>> & Pick<
export function useGetApiV10NewsletterSubscriptionInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>>, TError = ErrorType<unknown>>(
params?: GetApiV10NewsletterSubscriptionParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getNewsletterSubscription>>,
Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>,
TError,
Awaited<ReturnType<typeof getNewsletterSubscription>>
Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetNewsletterSubscriptionInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getNewsletterSubscription>>>, TError = ErrorType<unknown>>(
params?: GetNewsletterSubscriptionParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getNewsletterSubscription>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10NewsletterSubscriptionInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>>, TError = ErrorType<unknown>>(
params?: GetApiV10NewsletterSubscriptionParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get all newsletter subscriptions
*/
export function useGetNewsletterSubscriptionInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getNewsletterSubscription>>>, TError = ErrorType<unknown>>(
params?: GetNewsletterSubscriptionParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getNewsletterSubscription>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10NewsletterSubscriptionInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>>, TError = ErrorType<unknown>>(
params?: GetApiV10NewsletterSubscriptionParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetNewsletterSubscriptionInfiniteQueryOptions(params,options)
const queryOptions = getGetApiV10NewsletterSubscriptionInfiniteQueryOptions(params,options)
const query = useInfiniteQuery(queryOptions, queryClient) as UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -341,12 +341,12 @@ export function useGetNewsletterSubscriptionInfinite<TData = InfiniteData<Awaite
/**
* @summary Get all newsletter subscriptions
*/
export const prefetchGetNewsletterSubscriptionInfiniteQuery = async <TData = Awaited<ReturnType<typeof getNewsletterSubscription>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetNewsletterSubscriptionParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getNewsletterSubscription>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10NewsletterSubscriptionInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetApiV10NewsletterSubscriptionParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetNewsletterSubscriptionInfiniteQueryOptions(params,options)
const queryOptions = getGetApiV10NewsletterSubscriptionInfiniteQueryOptions(params,options)
await queryClient.prefetchInfiniteQuery(queryOptions);
......@@ -355,62 +355,62 @@ export const prefetchGetNewsletterSubscriptionInfiniteQuery = async <TData = Awa
export const getGetNewsletterSubscriptionQueryOptions = <TData = Awaited<ReturnType<typeof getNewsletterSubscription>>, TError = ErrorType<unknown>>(params?: GetNewsletterSubscriptionParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getNewsletterSubscription>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10NewsletterSubscriptionQueryOptions = <TData = Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError = ErrorType<unknown>>(params?: GetApiV10NewsletterSubscriptionParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetNewsletterSubscriptionQueryKey(params);
const queryKey = queryOptions?.queryKey ?? getGetApiV10NewsletterSubscriptionQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getNewsletterSubscription>>> = ({ signal }) => getNewsletterSubscription(params, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>> = ({ signal }) => getApiV10NewsletterSubscription(params, { signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getNewsletterSubscription>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetNewsletterSubscriptionQueryResult = NonNullable<Awaited<ReturnType<typeof getNewsletterSubscription>>>
export type GetNewsletterSubscriptionQueryError = ErrorType<unknown>
export type GetApiV10NewsletterSubscriptionQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>>
export type GetApiV10NewsletterSubscriptionQueryError = ErrorType<unknown>
export function useGetNewsletterSubscription<TData = Awaited<ReturnType<typeof getNewsletterSubscription>>, TError = ErrorType<unknown>>(
params: undefined | GetNewsletterSubscriptionParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getNewsletterSubscription>>, TError, TData>> & Pick<
export function useGetApiV10NewsletterSubscription<TData = Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError = ErrorType<unknown>>(
params: undefined | GetApiV10NewsletterSubscriptionParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getNewsletterSubscription>>,
Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>,
TError,
Awaited<ReturnType<typeof getNewsletterSubscription>>
Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetNewsletterSubscription<TData = Awaited<ReturnType<typeof getNewsletterSubscription>>, TError = ErrorType<unknown>>(
params?: GetNewsletterSubscriptionParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getNewsletterSubscription>>, TError, TData>> & Pick<
export function useGetApiV10NewsletterSubscription<TData = Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError = ErrorType<unknown>>(
params?: GetApiV10NewsletterSubscriptionParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getNewsletterSubscription>>,
Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>,
TError,
Awaited<ReturnType<typeof getNewsletterSubscription>>
Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetNewsletterSubscription<TData = Awaited<ReturnType<typeof getNewsletterSubscription>>, TError = ErrorType<unknown>>(
params?: GetNewsletterSubscriptionParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getNewsletterSubscription>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10NewsletterSubscription<TData = Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError = ErrorType<unknown>>(
params?: GetApiV10NewsletterSubscriptionParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get all newsletter subscriptions
*/
export function useGetNewsletterSubscription<TData = Awaited<ReturnType<typeof getNewsletterSubscription>>, TError = ErrorType<unknown>>(
params?: GetNewsletterSubscriptionParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getNewsletterSubscription>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10NewsletterSubscription<TData = Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError = ErrorType<unknown>>(
params?: GetApiV10NewsletterSubscriptionParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetNewsletterSubscriptionQueryOptions(params,options)
const queryOptions = getGetApiV10NewsletterSubscriptionQueryOptions(params,options)
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -422,12 +422,12 @@ export function useGetNewsletterSubscription<TData = Awaited<ReturnType<typeof g
/**
* @summary Get all newsletter subscriptions
*/
export const prefetchGetNewsletterSubscriptionQuery = async <TData = Awaited<ReturnType<typeof getNewsletterSubscription>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetNewsletterSubscriptionParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getNewsletterSubscription>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10NewsletterSubscriptionQuery = async <TData = Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetApiV10NewsletterSubscriptionParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10NewsletterSubscription>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetNewsletterSubscriptionQueryOptions(params,options)
const queryOptions = getGetApiV10NewsletterSubscriptionQueryOptions(params,options)
await queryClient.prefetchQuery(queryOptions);
......@@ -440,29 +440,29 @@ export const prefetchGetNewsletterSubscriptionQuery = async <TData = Awaited<Ret
* Register an email to receive information from the website
* @summary Subscribe newsletter email
*/
export type postNewsletterSubscriptionResponse200 = {
data: PostNewsletterSubscription200
export type postApiV10NewsletterSubscriptionResponse200 = {
data: PostApiV10NewsletterSubscription200
status: 200
}
export type postNewsletterSubscriptionResponseSuccess = (postNewsletterSubscriptionResponse200) & {
export type postApiV10NewsletterSubscriptionResponseSuccess = (postApiV10NewsletterSubscriptionResponse200) & {
headers: Headers;
};
;
export type postNewsletterSubscriptionResponse = (postNewsletterSubscriptionResponseSuccess)
export type postApiV10NewsletterSubscriptionResponse = (postApiV10NewsletterSubscriptionResponseSuccess)
export const getPostNewsletterSubscriptionUrl = () => {
export const getPostApiV10NewsletterSubscriptionUrl = () => {
return `/newsletterSubscription`
return `/api/v1.0/newsletterSubscription`
}
export const postNewsletterSubscription = async (newsletterSubscriptionMutate: NewsletterSubscriptionMutate, options?: RequestInit): Promise<postNewsletterSubscriptionResponse> => {
export const postApiV10NewsletterSubscription = async (newsletterSubscriptionMutate: NewsletterSubscriptionMutate, options?: RequestInit): Promise<postApiV10NewsletterSubscriptionResponse> => {
return useCustomClient<postNewsletterSubscriptionResponse>(getPostNewsletterSubscriptionUrl(),
return useCustomClient<postApiV10NewsletterSubscriptionResponse>(getPostApiV10NewsletterSubscriptionUrl(),
{
...options,
method: 'POST',
......@@ -475,11 +475,11 @@ export const postNewsletterSubscription = async (newsletterSubscriptionMutate: N
export const getPostNewsletterSubscriptionMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postNewsletterSubscription>>, TError,{data: BodyType<NewsletterSubscriptionMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postNewsletterSubscription>>, TError,{data: BodyType<NewsletterSubscriptionMutate>}, TContext> => {
export const getPostApiV10NewsletterSubscriptionMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postApiV10NewsletterSubscription>>, TError,{data: BodyType<NewsletterSubscriptionMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postApiV10NewsletterSubscription>>, TError,{data: BodyType<NewsletterSubscriptionMutate>}, TContext> => {
const mutationKey = ['postNewsletterSubscription'];
const mutationKey = ['postApiV10NewsletterSubscription'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -489,10 +489,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof postNewsletterSubscription>>, {data: BodyType<NewsletterSubscriptionMutate>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof postApiV10NewsletterSubscription>>, {data: BodyType<NewsletterSubscriptionMutate>}> = (props) => {
const {data} = props ?? {};
return postNewsletterSubscription(data,requestOptions)
return postApiV10NewsletterSubscription(data,requestOptions)
}
......@@ -500,23 +500,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PostNewsletterSubscriptionMutationResult = NonNullable<Awaited<ReturnType<typeof postNewsletterSubscription>>>
export type PostNewsletterSubscriptionMutationBody = BodyType<NewsletterSubscriptionMutate>
export type PostNewsletterSubscriptionMutationError = ErrorType<unknown>
export type PostApiV10NewsletterSubscriptionMutationResult = NonNullable<Awaited<ReturnType<typeof postApiV10NewsletterSubscription>>>
export type PostApiV10NewsletterSubscriptionMutationBody = BodyType<NewsletterSubscriptionMutate>
export type PostApiV10NewsletterSubscriptionMutationError = ErrorType<unknown>
/**
* @summary Subscribe newsletter email
*/
export const usePostNewsletterSubscription = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postNewsletterSubscription>>, TError,{data: BodyType<NewsletterSubscriptionMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePostApiV10NewsletterSubscription = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postApiV10NewsletterSubscription>>, TError,{data: BodyType<NewsletterSubscriptionMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof postNewsletterSubscription>>,
Awaited<ReturnType<typeof postApiV10NewsletterSubscription>>,
TError,
{data: BodyType<NewsletterSubscriptionMutate>},
TContext
> => {
const mutationOptions = getPostNewsletterSubscriptionMutationOptions(options);
const mutationOptions = getPostApiV10NewsletterSubscriptionMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import {
......@@ -30,9 +30,9 @@ import type {
} from '@tanstack/react-query';
import type {
GetPageConfigParams,
PostPageConfigBody,
PutPageConfigIdBody
GetApiV10PageConfigParams,
PostApiV10PageConfigBody,
PutApiV10PageConfigIdBody
} from '../models';
import { useCustomClient } from '../mutator/custom-client';
......@@ -48,36 +48,36 @@ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
* Retrieve hierarchical page config by its ID
* @summary Get hierarchical pageConfig by ID
*/
export type getPageConfigIdResponse200 = {
export type getApiV10PageConfigIdResponse200 = {
data: void
status: 200
}
export type getPageConfigIdResponse404 = {
export type getApiV10PageConfigIdResponse404 = {
data: void
status: 404
}
export type getPageConfigIdResponseSuccess = (getPageConfigIdResponse200) & {
export type getApiV10PageConfigIdResponseSuccess = (getApiV10PageConfigIdResponse200) & {
headers: Headers;
};
export type getPageConfigIdResponseError = (getPageConfigIdResponse404) & {
export type getApiV10PageConfigIdResponseError = (getApiV10PageConfigIdResponse404) & {
headers: Headers;
};
export type getPageConfigIdResponse = (getPageConfigIdResponseSuccess | getPageConfigIdResponseError)
export type getApiV10PageConfigIdResponse = (getApiV10PageConfigIdResponseSuccess | getApiV10PageConfigIdResponseError)
export const getGetPageConfigIdUrl = (id: string,) => {
export const getGetApiV10PageConfigIdUrl = (id: string,) => {
return `/pageConfig/${id}`
return `/api/v1.0/pageConfig/${id}`
}
export const getPageConfigId = async (id: string, options?: RequestInit): Promise<getPageConfigIdResponse> => {
export const getApiV10PageConfigId = async (id: string, options?: RequestInit): Promise<getApiV10PageConfigIdResponse> => {
return useCustomClient<getPageConfigIdResponse>(getGetPageConfigIdUrl(id),
return useCustomClient<getApiV10PageConfigIdResponse>(getGetApiV10PageConfigIdUrl(id),
{
...options,
method: 'GET'
......@@ -90,75 +90,75 @@ export const getPageConfigId = async (id: string, options?: RequestInit): Promis
export const getGetPageConfigIdInfiniteQueryKey = (id?: string,) => {
export const getGetApiV10PageConfigIdInfiniteQueryKey = (id?: string,) => {
return [
'infinite', `/pageConfig/${id}`
'infinite', `/api/v1.0/pageConfig/${id}`
] as const;
}
export const getGetPageConfigIdQueryKey = (id?: string,) => {
export const getGetApiV10PageConfigIdQueryKey = (id?: string,) => {
return [
`/pageConfig/${id}`
`/api/v1.0/pageConfig/${id}`
] as const;
}
export const getGetPageConfigIdInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getPageConfigId>>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getPageConfigId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10PageConfigIdInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getApiV10PageConfigId>>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetPageConfigIdInfiniteQueryKey(id);
const queryKey = queryOptions?.queryKey ?? getGetApiV10PageConfigIdInfiniteQueryKey(id);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getPageConfigId>>> = ({ signal }) => getPageConfigId(id, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10PageConfigId>>> = ({ signal }) => getApiV10PageConfigId(id, { signal, ...requestOptions });
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getPageConfigId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetPageConfigIdInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getPageConfigId>>>
export type GetPageConfigIdInfiniteQueryError = ErrorType<void>
export type GetApiV10PageConfigIdInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10PageConfigId>>>
export type GetApiV10PageConfigIdInfiniteQueryError = ErrorType<void>
export function useGetPageConfigIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getPageConfigId>>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getPageConfigId>>, TError, TData>> & Pick<
export function useGetApiV10PageConfigIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10PageConfigId>>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getPageConfigId>>,
Awaited<ReturnType<typeof getApiV10PageConfigId>>,
TError,
Awaited<ReturnType<typeof getPageConfigId>>
Awaited<ReturnType<typeof getApiV10PageConfigId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetPageConfigIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getPageConfigId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getPageConfigId>>, TError, TData>> & Pick<
export function useGetApiV10PageConfigIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10PageConfigId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getPageConfigId>>,
Awaited<ReturnType<typeof getApiV10PageConfigId>>,
TError,
Awaited<ReturnType<typeof getPageConfigId>>
Awaited<ReturnType<typeof getApiV10PageConfigId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetPageConfigIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getPageConfigId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getPageConfigId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10PageConfigIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10PageConfigId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get hierarchical pageConfig by ID
*/
export function useGetPageConfigIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getPageConfigId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getPageConfigId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10PageConfigIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10PageConfigId>>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetPageConfigIdInfiniteQueryOptions(id,options)
const queryOptions = getGetApiV10PageConfigIdInfiniteQueryOptions(id,options)
const query = useInfiniteQuery(queryOptions, queryClient) as UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -170,12 +170,12 @@ export function useGetPageConfigIdInfinite<TData = InfiniteData<Awaited<ReturnTy
/**
* @summary Get hierarchical pageConfig by ID
*/
export const prefetchGetPageConfigIdInfiniteQuery = async <TData = Awaited<ReturnType<typeof getPageConfigId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getPageConfigId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10PageConfigIdInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetPageConfigIdInfiniteQueryOptions(id,options)
const queryOptions = getGetApiV10PageConfigIdInfiniteQueryOptions(id,options)
await queryClient.prefetchInfiniteQuery(queryOptions);
......@@ -184,62 +184,62 @@ export const prefetchGetPageConfigIdInfiniteQuery = async <TData = Awaited<Retur
export const getGetPageConfigIdQueryOptions = <TData = Awaited<ReturnType<typeof getPageConfigId>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getPageConfigId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10PageConfigIdQueryOptions = <TData = Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError = ErrorType<void>>(id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetPageConfigIdQueryKey(id);
const queryKey = queryOptions?.queryKey ?? getGetApiV10PageConfigIdQueryKey(id);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getPageConfigId>>> = ({ signal }) => getPageConfigId(id, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10PageConfigId>>> = ({ signal }) => getApiV10PageConfigId(id, { signal, ...requestOptions });
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getPageConfigId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetPageConfigIdQueryResult = NonNullable<Awaited<ReturnType<typeof getPageConfigId>>>
export type GetPageConfigIdQueryError = ErrorType<void>
export type GetApiV10PageConfigIdQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10PageConfigId>>>
export type GetApiV10PageConfigIdQueryError = ErrorType<void>
export function useGetPageConfigId<TData = Awaited<ReturnType<typeof getPageConfigId>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getPageConfigId>>, TError, TData>> & Pick<
export function useGetApiV10PageConfigId<TData = Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError = ErrorType<void>>(
id: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getPageConfigId>>,
Awaited<ReturnType<typeof getApiV10PageConfigId>>,
TError,
Awaited<ReturnType<typeof getPageConfigId>>
Awaited<ReturnType<typeof getApiV10PageConfigId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetPageConfigId<TData = Awaited<ReturnType<typeof getPageConfigId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getPageConfigId>>, TError, TData>> & Pick<
export function useGetApiV10PageConfigId<TData = Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getPageConfigId>>,
Awaited<ReturnType<typeof getApiV10PageConfigId>>,
TError,
Awaited<ReturnType<typeof getPageConfigId>>
Awaited<ReturnType<typeof getApiV10PageConfigId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetPageConfigId<TData = Awaited<ReturnType<typeof getPageConfigId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getPageConfigId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10PageConfigId<TData = Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get hierarchical pageConfig by ID
*/
export function useGetPageConfigId<TData = Awaited<ReturnType<typeof getPageConfigId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getPageConfigId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10PageConfigId<TData = Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError = ErrorType<void>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetPageConfigIdQueryOptions(id,options)
const queryOptions = getGetApiV10PageConfigIdQueryOptions(id,options)
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -251,12 +251,12 @@ export function useGetPageConfigId<TData = Awaited<ReturnType<typeof getPageConf
/**
* @summary Get hierarchical pageConfig by ID
*/
export const prefetchGetPageConfigIdQuery = async <TData = Awaited<ReturnType<typeof getPageConfigId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getPageConfigId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10PageConfigIdQuery = async <TData = Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError = ErrorType<void>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfigId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetPageConfigIdQueryOptions(id,options)
const queryOptions = getGetApiV10PageConfigIdQueryOptions(id,options)
await queryClient.prefetchQuery(queryOptions);
......@@ -269,54 +269,54 @@ export const prefetchGetPageConfigIdQuery = async <TData = Awaited<ReturnType<ty
* Update a single pageConfig record by its ID. level is computed if parent_id changes and must not be sent.
* @summary Update pageConfig by ID
*/
export type putPageConfigIdResponse200 = {
export type putApiV10PageConfigIdResponse200 = {
data: void
status: 200
}
export type putPageConfigIdResponse404 = {
export type putApiV10PageConfigIdResponse404 = {
data: void
status: 404
}
export type putPageConfigIdResponseSuccess = (putPageConfigIdResponse200) & {
export type putApiV10PageConfigIdResponseSuccess = (putApiV10PageConfigIdResponse200) & {
headers: Headers;
};
export type putPageConfigIdResponseError = (putPageConfigIdResponse404) & {
export type putApiV10PageConfigIdResponseError = (putApiV10PageConfigIdResponse404) & {
headers: Headers;
};
export type putPageConfigIdResponse = (putPageConfigIdResponseSuccess | putPageConfigIdResponseError)
export type putApiV10PageConfigIdResponse = (putApiV10PageConfigIdResponseSuccess | putApiV10PageConfigIdResponseError)
export const getPutPageConfigIdUrl = (id: string,) => {
export const getPutApiV10PageConfigIdUrl = (id: string,) => {
return `/pageConfig/${id}`
return `/api/v1.0/pageConfig/${id}`
}
export const putPageConfigId = async (id: string,
putPageConfigIdBody: PutPageConfigIdBody, options?: RequestInit): Promise<putPageConfigIdResponse> => {
export const putApiV10PageConfigId = async (id: string,
putApiV10PageConfigIdBody: PutApiV10PageConfigIdBody, options?: RequestInit): Promise<putApiV10PageConfigIdResponse> => {
return useCustomClient<putPageConfigIdResponse>(getPutPageConfigIdUrl(id),
return useCustomClient<putApiV10PageConfigIdResponse>(getPutApiV10PageConfigIdUrl(id),
{
...options,
method: 'PUT',
headers: { 'Content-Type': 'application/json', ...options?.headers },
body: JSON.stringify(
putPageConfigIdBody,)
putApiV10PageConfigIdBody,)
}
);}
export const getPutPageConfigIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putPageConfigId>>, TError,{id: string;data: BodyType<PutPageConfigIdBody>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof putPageConfigId>>, TError,{id: string;data: BodyType<PutPageConfigIdBody>}, TContext> => {
export const getPutApiV10PageConfigIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putApiV10PageConfigId>>, TError,{id: string;data: BodyType<PutApiV10PageConfigIdBody>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof putApiV10PageConfigId>>, TError,{id: string;data: BodyType<PutApiV10PageConfigIdBody>}, TContext> => {
const mutationKey = ['putPageConfigId'];
const mutationKey = ['putApiV10PageConfigId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -326,10 +326,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof putPageConfigId>>, {id: string;data: BodyType<PutPageConfigIdBody>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof putApiV10PageConfigId>>, {id: string;data: BodyType<PutApiV10PageConfigIdBody>}> = (props) => {
const {id,data} = props ?? {};
return putPageConfigId(id,data,requestOptions)
return putApiV10PageConfigId(id,data,requestOptions)
}
......@@ -337,23 +337,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PutPageConfigIdMutationResult = NonNullable<Awaited<ReturnType<typeof putPageConfigId>>>
export type PutPageConfigIdMutationBody = BodyType<PutPageConfigIdBody>
export type PutPageConfigIdMutationError = ErrorType<void>
export type PutApiV10PageConfigIdMutationResult = NonNullable<Awaited<ReturnType<typeof putApiV10PageConfigId>>>
export type PutApiV10PageConfigIdMutationBody = BodyType<PutApiV10PageConfigIdBody>
export type PutApiV10PageConfigIdMutationError = ErrorType<void>
/**
* @summary Update pageConfig by ID
*/
export const usePutPageConfigId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putPageConfigId>>, TError,{id: string;data: BodyType<PutPageConfigIdBody>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePutApiV10PageConfigId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putApiV10PageConfigId>>, TError,{id: string;data: BodyType<PutApiV10PageConfigIdBody>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof putPageConfigId>>,
Awaited<ReturnType<typeof putApiV10PageConfigId>>,
TError,
{id: string;data: BodyType<PutPageConfigIdBody>},
{id: string;data: BodyType<PutApiV10PageConfigIdBody>},
TContext
> => {
const mutationOptions = getPutPageConfigIdMutationOptions(options);
const mutationOptions = getPutApiV10PageConfigIdMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
......@@ -361,36 +361,36 @@ export const usePutPageConfigId = <TError = ErrorType<void>,
* Delete a single pageConfig record by its ID
* @summary Delete pageConfig by ID
*/
export type deletePageConfigIdResponse200 = {
export type deleteApiV10PageConfigIdResponse200 = {
data: void
status: 200
}
export type deletePageConfigIdResponse404 = {
export type deleteApiV10PageConfigIdResponse404 = {
data: void
status: 404
}
export type deletePageConfigIdResponseSuccess = (deletePageConfigIdResponse200) & {
export type deleteApiV10PageConfigIdResponseSuccess = (deleteApiV10PageConfigIdResponse200) & {
headers: Headers;
};
export type deletePageConfigIdResponseError = (deletePageConfigIdResponse404) & {
export type deleteApiV10PageConfigIdResponseError = (deleteApiV10PageConfigIdResponse404) & {
headers: Headers;
};
export type deletePageConfigIdResponse = (deletePageConfigIdResponseSuccess | deletePageConfigIdResponseError)
export type deleteApiV10PageConfigIdResponse = (deleteApiV10PageConfigIdResponseSuccess | deleteApiV10PageConfigIdResponseError)
export const getDeletePageConfigIdUrl = (id: string,) => {
export const getDeleteApiV10PageConfigIdUrl = (id: string,) => {
return `/pageConfig/${id}`
return `/api/v1.0/pageConfig/${id}`
}
export const deletePageConfigId = async (id: string, options?: RequestInit): Promise<deletePageConfigIdResponse> => {
export const deleteApiV10PageConfigId = async (id: string, options?: RequestInit): Promise<deleteApiV10PageConfigIdResponse> => {
return useCustomClient<deletePageConfigIdResponse>(getDeletePageConfigIdUrl(id),
return useCustomClient<deleteApiV10PageConfigIdResponse>(getDeleteApiV10PageConfigIdUrl(id),
{
...options,
method: 'DELETE'
......@@ -402,11 +402,11 @@ export const deletePageConfigId = async (id: string, options?: RequestInit): Pro
export const getDeletePageConfigIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deletePageConfigId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof deletePageConfigId>>, TError,{id: string}, TContext> => {
export const getDeleteApiV10PageConfigIdMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10PageConfigId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10PageConfigId>>, TError,{id: string}, TContext> => {
const mutationKey = ['deletePageConfigId'];
const mutationKey = ['deleteApiV10PageConfigId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -416,10 +416,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deletePageConfigId>>, {id: string}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteApiV10PageConfigId>>, {id: string}> = (props) => {
const {id} = props ?? {};
return deletePageConfigId(id,requestOptions)
return deleteApiV10PageConfigId(id,requestOptions)
}
......@@ -427,23 +427,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type DeletePageConfigIdMutationResult = NonNullable<Awaited<ReturnType<typeof deletePageConfigId>>>
export type DeleteApiV10PageConfigIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteApiV10PageConfigId>>>
export type DeletePageConfigIdMutationError = ErrorType<void>
export type DeleteApiV10PageConfigIdMutationError = ErrorType<void>
/**
* @summary Delete pageConfig by ID
*/
export const useDeletePageConfigId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deletePageConfigId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const useDeleteApiV10PageConfigId = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10PageConfigId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof deletePageConfigId>>,
Awaited<ReturnType<typeof deleteApiV10PageConfigId>>,
TError,
{id: string},
TContext
> => {
const mutationOptions = getDeletePageConfigIdMutationOptions(options);
const mutationOptions = getDeleteApiV10PageConfigIdMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
......@@ -451,19 +451,19 @@ export const useDeletePageConfigId = <TError = ErrorType<void>,
* Retrieve hierarchical page config by id, static_link, or code. If no parameters are provided, returns the root hierarchical structure.
* @summary Get hierarchical pageConfig
*/
export type getPageConfigResponse200 = {
export type getApiV10PageConfigResponse200 = {
data: void
status: 200
}
export type getPageConfigResponseSuccess = (getPageConfigResponse200) & {
export type getApiV10PageConfigResponseSuccess = (getApiV10PageConfigResponse200) & {
headers: Headers;
};
;
export type getPageConfigResponse = (getPageConfigResponseSuccess)
export type getApiV10PageConfigResponse = (getApiV10PageConfigResponseSuccess)
export const getGetPageConfigUrl = (params?: GetPageConfigParams,) => {
export const getGetApiV10PageConfigUrl = (params?: GetApiV10PageConfigParams,) => {
const normalizedParams = new URLSearchParams();
Object.entries(params || {}).forEach(([key, value]) => {
......@@ -475,12 +475,12 @@ export const getGetPageConfigUrl = (params?: GetPageConfigParams,) => {
const stringifiedParams = normalizedParams.toString();
return stringifiedParams.length > 0 ? `/pageConfig?${stringifiedParams}` : `/pageConfig`
return stringifiedParams.length > 0 ? `/api/v1.0/pageConfig?${stringifiedParams}` : `/api/v1.0/pageConfig`
}
export const getPageConfig = async (params?: GetPageConfigParams, options?: RequestInit): Promise<getPageConfigResponse> => {
export const getApiV10PageConfig = async (params?: GetApiV10PageConfigParams, options?: RequestInit): Promise<getApiV10PageConfigResponse> => {
return useCustomClient<getPageConfigResponse>(getGetPageConfigUrl(params),
return useCustomClient<getApiV10PageConfigResponse>(getGetApiV10PageConfigUrl(params),
{
...options,
method: 'GET'
......@@ -493,75 +493,75 @@ export const getPageConfig = async (params?: GetPageConfigParams, options?: Requ
export const getGetPageConfigInfiniteQueryKey = (params?: GetPageConfigParams,) => {
export const getGetApiV10PageConfigInfiniteQueryKey = (params?: GetApiV10PageConfigParams,) => {
return [
'infinite', `/pageConfig`, ...(params ? [params]: [])
'infinite', `/api/v1.0/pageConfig`, ...(params ? [params]: [])
] as const;
}
export const getGetPageConfigQueryKey = (params?: GetPageConfigParams,) => {
export const getGetApiV10PageConfigQueryKey = (params?: GetApiV10PageConfigParams,) => {
return [
`/pageConfig`, ...(params ? [params]: [])
`/api/v1.0/pageConfig`, ...(params ? [params]: [])
] as const;
}
export const getGetPageConfigInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getPageConfig>>>, TError = ErrorType<unknown>>(params?: GetPageConfigParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getPageConfig>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10PageConfigInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getApiV10PageConfig>>>, TError = ErrorType<unknown>>(params?: GetApiV10PageConfigParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfig>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetPageConfigInfiniteQueryKey(params);
const queryKey = queryOptions?.queryKey ?? getGetApiV10PageConfigInfiniteQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getPageConfig>>> = ({ signal }) => getPageConfig(params, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10PageConfig>>> = ({ signal }) => getApiV10PageConfig(params, { signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getPageConfig>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfig>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetPageConfigInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getPageConfig>>>
export type GetPageConfigInfiniteQueryError = ErrorType<unknown>
export type GetApiV10PageConfigInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10PageConfig>>>
export type GetApiV10PageConfigInfiniteQueryError = ErrorType<unknown>
export function useGetPageConfigInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getPageConfig>>>, TError = ErrorType<unknown>>(
params: undefined | GetPageConfigParams, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getPageConfig>>, TError, TData>> & Pick<
export function useGetApiV10PageConfigInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10PageConfig>>>, TError = ErrorType<unknown>>(
params: undefined | GetApiV10PageConfigParams, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfig>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getPageConfig>>,
Awaited<ReturnType<typeof getApiV10PageConfig>>,
TError,
Awaited<ReturnType<typeof getPageConfig>>
Awaited<ReturnType<typeof getApiV10PageConfig>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetPageConfigInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getPageConfig>>>, TError = ErrorType<unknown>>(
params?: GetPageConfigParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getPageConfig>>, TError, TData>> & Pick<
export function useGetApiV10PageConfigInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10PageConfig>>>, TError = ErrorType<unknown>>(
params?: GetApiV10PageConfigParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfig>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getPageConfig>>,
Awaited<ReturnType<typeof getApiV10PageConfig>>,
TError,
Awaited<ReturnType<typeof getPageConfig>>
Awaited<ReturnType<typeof getApiV10PageConfig>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetPageConfigInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getPageConfig>>>, TError = ErrorType<unknown>>(
params?: GetPageConfigParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getPageConfig>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10PageConfigInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10PageConfig>>>, TError = ErrorType<unknown>>(
params?: GetApiV10PageConfigParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfig>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get hierarchical pageConfig
*/
export function useGetPageConfigInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getPageConfig>>>, TError = ErrorType<unknown>>(
params?: GetPageConfigParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getPageConfig>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10PageConfigInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10PageConfig>>>, TError = ErrorType<unknown>>(
params?: GetApiV10PageConfigParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfig>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetPageConfigInfiniteQueryOptions(params,options)
const queryOptions = getGetApiV10PageConfigInfiniteQueryOptions(params,options)
const query = useInfiniteQuery(queryOptions, queryClient) as UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -573,12 +573,12 @@ export function useGetPageConfigInfinite<TData = InfiniteData<Awaited<ReturnType
/**
* @summary Get hierarchical pageConfig
*/
export const prefetchGetPageConfigInfiniteQuery = async <TData = Awaited<ReturnType<typeof getPageConfig>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetPageConfigParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getPageConfig>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10PageConfigInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10PageConfig>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetApiV10PageConfigParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfig>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetPageConfigInfiniteQueryOptions(params,options)
const queryOptions = getGetApiV10PageConfigInfiniteQueryOptions(params,options)
await queryClient.prefetchInfiniteQuery(queryOptions);
......@@ -587,62 +587,62 @@ export const prefetchGetPageConfigInfiniteQuery = async <TData = Awaited<ReturnT
export const getGetPageConfigQueryOptions = <TData = Awaited<ReturnType<typeof getPageConfig>>, TError = ErrorType<unknown>>(params?: GetPageConfigParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getPageConfig>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10PageConfigQueryOptions = <TData = Awaited<ReturnType<typeof getApiV10PageConfig>>, TError = ErrorType<unknown>>(params?: GetApiV10PageConfigParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfig>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetPageConfigQueryKey(params);
const queryKey = queryOptions?.queryKey ?? getGetApiV10PageConfigQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getPageConfig>>> = ({ signal }) => getPageConfig(params, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10PageConfig>>> = ({ signal }) => getApiV10PageConfig(params, { signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getPageConfig>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfig>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetPageConfigQueryResult = NonNullable<Awaited<ReturnType<typeof getPageConfig>>>
export type GetPageConfigQueryError = ErrorType<unknown>
export type GetApiV10PageConfigQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10PageConfig>>>
export type GetApiV10PageConfigQueryError = ErrorType<unknown>
export function useGetPageConfig<TData = Awaited<ReturnType<typeof getPageConfig>>, TError = ErrorType<unknown>>(
params: undefined | GetPageConfigParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getPageConfig>>, TError, TData>> & Pick<
export function useGetApiV10PageConfig<TData = Awaited<ReturnType<typeof getApiV10PageConfig>>, TError = ErrorType<unknown>>(
params: undefined | GetApiV10PageConfigParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfig>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getPageConfig>>,
Awaited<ReturnType<typeof getApiV10PageConfig>>,
TError,
Awaited<ReturnType<typeof getPageConfig>>
Awaited<ReturnType<typeof getApiV10PageConfig>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetPageConfig<TData = Awaited<ReturnType<typeof getPageConfig>>, TError = ErrorType<unknown>>(
params?: GetPageConfigParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getPageConfig>>, TError, TData>> & Pick<
export function useGetApiV10PageConfig<TData = Awaited<ReturnType<typeof getApiV10PageConfig>>, TError = ErrorType<unknown>>(
params?: GetApiV10PageConfigParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfig>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getPageConfig>>,
Awaited<ReturnType<typeof getApiV10PageConfig>>,
TError,
Awaited<ReturnType<typeof getPageConfig>>
Awaited<ReturnType<typeof getApiV10PageConfig>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetPageConfig<TData = Awaited<ReturnType<typeof getPageConfig>>, TError = ErrorType<unknown>>(
params?: GetPageConfigParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getPageConfig>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10PageConfig<TData = Awaited<ReturnType<typeof getApiV10PageConfig>>, TError = ErrorType<unknown>>(
params?: GetApiV10PageConfigParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfig>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get hierarchical pageConfig
*/
export function useGetPageConfig<TData = Awaited<ReturnType<typeof getPageConfig>>, TError = ErrorType<unknown>>(
params?: GetPageConfigParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getPageConfig>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10PageConfig<TData = Awaited<ReturnType<typeof getApiV10PageConfig>>, TError = ErrorType<unknown>>(
params?: GetApiV10PageConfigParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfig>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetPageConfigQueryOptions(params,options)
const queryOptions = getGetApiV10PageConfigQueryOptions(params,options)
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -654,12 +654,12 @@ export function useGetPageConfig<TData = Awaited<ReturnType<typeof getPageConfig
/**
* @summary Get hierarchical pageConfig
*/
export const prefetchGetPageConfigQuery = async <TData = Awaited<ReturnType<typeof getPageConfig>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetPageConfigParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getPageConfig>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10PageConfigQuery = async <TData = Awaited<ReturnType<typeof getApiV10PageConfig>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetApiV10PageConfigParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10PageConfig>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetPageConfigQueryOptions(params,options)
const queryOptions = getGetApiV10PageConfigQueryOptions(params,options)
await queryClient.prefetchQuery(queryOptions);
......@@ -672,46 +672,46 @@ export const prefetchGetPageConfigQuery = async <TData = Awaited<ReturnType<type
* Create a new pageConfig record. parent_id is required. level is computed from parent and must not be sent.
* @summary Create a pageConfig
*/
export type postPageConfigResponse200 = {
export type postApiV10PageConfigResponse200 = {
data: void
status: 200
}
export type postPageConfigResponseSuccess = (postPageConfigResponse200) & {
export type postApiV10PageConfigResponseSuccess = (postApiV10PageConfigResponse200) & {
headers: Headers;
};
;
export type postPageConfigResponse = (postPageConfigResponseSuccess)
export type postApiV10PageConfigResponse = (postApiV10PageConfigResponseSuccess)
export const getPostPageConfigUrl = () => {
export const getPostApiV10PageConfigUrl = () => {
return `/pageConfig`
return `/api/v1.0/pageConfig`
}
export const postPageConfig = async (postPageConfigBody: PostPageConfigBody, options?: RequestInit): Promise<postPageConfigResponse> => {
export const postApiV10PageConfig = async (postApiV10PageConfigBody: PostApiV10PageConfigBody, options?: RequestInit): Promise<postApiV10PageConfigResponse> => {
return useCustomClient<postPageConfigResponse>(getPostPageConfigUrl(),
return useCustomClient<postApiV10PageConfigResponse>(getPostApiV10PageConfigUrl(),
{
...options,
method: 'POST',
headers: { 'Content-Type': 'application/json', ...options?.headers },
body: JSON.stringify(
postPageConfigBody,)
postApiV10PageConfigBody,)
}
);}
export const getPostPageConfigMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postPageConfig>>, TError,{data: BodyType<PostPageConfigBody>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postPageConfig>>, TError,{data: BodyType<PostPageConfigBody>}, TContext> => {
export const getPostApiV10PageConfigMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postApiV10PageConfig>>, TError,{data: BodyType<PostApiV10PageConfigBody>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postApiV10PageConfig>>, TError,{data: BodyType<PostApiV10PageConfigBody>}, TContext> => {
const mutationKey = ['postPageConfig'];
const mutationKey = ['postApiV10PageConfig'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -721,10 +721,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof postPageConfig>>, {data: BodyType<PostPageConfigBody>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof postApiV10PageConfig>>, {data: BodyType<PostApiV10PageConfigBody>}> = (props) => {
const {data} = props ?? {};
return postPageConfig(data,requestOptions)
return postApiV10PageConfig(data,requestOptions)
}
......@@ -732,23 +732,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PostPageConfigMutationResult = NonNullable<Awaited<ReturnType<typeof postPageConfig>>>
export type PostPageConfigMutationBody = BodyType<PostPageConfigBody>
export type PostPageConfigMutationError = ErrorType<unknown>
export type PostApiV10PageConfigMutationResult = NonNullable<Awaited<ReturnType<typeof postApiV10PageConfig>>>
export type PostApiV10PageConfigMutationBody = BodyType<PostApiV10PageConfigBody>
export type PostApiV10PageConfigMutationError = ErrorType<unknown>
/**
* @summary Create a pageConfig
*/
export const usePostPageConfig = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postPageConfig>>, TError,{data: BodyType<PostPageConfigBody>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePostApiV10PageConfig = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postApiV10PageConfig>>, TError,{data: BodyType<PostApiV10PageConfigBody>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof postPageConfig>>,
Awaited<ReturnType<typeof postApiV10PageConfig>>,
TError,
{data: BodyType<PostPageConfigBody>},
{data: BodyType<PostApiV10PageConfigBody>},
TContext
> => {
const mutationOptions = getPostPageConfigMutationOptions(options);
const mutationOptions = getPostApiV10PageConfigMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import {
......@@ -30,9 +30,9 @@ import type {
} from '@tanstack/react-query';
import type {
GetSiteInformation200,
GetSiteInformationParams,
PutSiteInformation200,
GetApiV10SiteInformation200,
GetApiV10SiteInformationParams,
PutApiV10SiteInformation200,
SiteInformationBranchMutate,
SiteInformationSocialMutate,
SiteInformationUpdateBody
......@@ -51,19 +51,19 @@ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
* Retrieve current public site information configuration.
* @summary Get current site information
*/
export type getSiteInformationResponse200 = {
data: GetSiteInformation200
export type getApiV10SiteInformationResponse200 = {
data: GetApiV10SiteInformation200
status: 200
}
export type getSiteInformationResponseSuccess = (getSiteInformationResponse200) & {
export type getApiV10SiteInformationResponseSuccess = (getApiV10SiteInformationResponse200) & {
headers: Headers;
};
;
export type getSiteInformationResponse = (getSiteInformationResponseSuccess)
export type getApiV10SiteInformationResponse = (getApiV10SiteInformationResponseSuccess)
export const getGetSiteInformationUrl = (params?: GetSiteInformationParams,) => {
export const getGetApiV10SiteInformationUrl = (params?: GetApiV10SiteInformationParams,) => {
const normalizedParams = new URLSearchParams();
Object.entries(params || {}).forEach(([key, value]) => {
......@@ -75,12 +75,12 @@ export const getGetSiteInformationUrl = (params?: GetSiteInformationParams,) =>
const stringifiedParams = normalizedParams.toString();
return stringifiedParams.length > 0 ? `/siteInformation?${stringifiedParams}` : `/siteInformation`
return stringifiedParams.length > 0 ? `/api/v1.0/siteInformation?${stringifiedParams}` : `/api/v1.0/siteInformation`
}
export const getSiteInformation = async (params?: GetSiteInformationParams, options?: RequestInit): Promise<getSiteInformationResponse> => {
export const getApiV10SiteInformation = async (params?: GetApiV10SiteInformationParams, options?: RequestInit): Promise<getApiV10SiteInformationResponse> => {
return useCustomClient<getSiteInformationResponse>(getGetSiteInformationUrl(params),
return useCustomClient<getApiV10SiteInformationResponse>(getGetApiV10SiteInformationUrl(params),
{
...options,
method: 'GET'
......@@ -93,75 +93,75 @@ export const getSiteInformation = async (params?: GetSiteInformationParams, opti
export const getGetSiteInformationInfiniteQueryKey = (params?: GetSiteInformationParams,) => {
export const getGetApiV10SiteInformationInfiniteQueryKey = (params?: GetApiV10SiteInformationParams,) => {
return [
'infinite', `/siteInformation`, ...(params ? [params]: [])
'infinite', `/api/v1.0/siteInformation`, ...(params ? [params]: [])
] as const;
}
export const getGetSiteInformationQueryKey = (params?: GetSiteInformationParams,) => {
export const getGetApiV10SiteInformationQueryKey = (params?: GetApiV10SiteInformationParams,) => {
return [
`/siteInformation`, ...(params ? [params]: [])
`/api/v1.0/siteInformation`, ...(params ? [params]: [])
] as const;
}
export const getGetSiteInformationInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getSiteInformation>>>, TError = ErrorType<unknown>>(params?: GetSiteInformationParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformation>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10SiteInformationInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getApiV10SiteInformation>>>, TError = ErrorType<unknown>>(params?: GetApiV10SiteInformationParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetSiteInformationInfiniteQueryKey(params);
const queryKey = queryOptions?.queryKey ?? getGetApiV10SiteInformationInfiniteQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getSiteInformation>>> = ({ signal }) => getSiteInformation(params, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10SiteInformation>>> = ({ signal }) => getApiV10SiteInformation(params, { signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformation>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetSiteInformationInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getSiteInformation>>>
export type GetSiteInformationInfiniteQueryError = ErrorType<unknown>
export type GetApiV10SiteInformationInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10SiteInformation>>>
export type GetApiV10SiteInformationInfiniteQueryError = ErrorType<unknown>
export function useGetSiteInformationInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getSiteInformation>>>, TError = ErrorType<unknown>>(
params: undefined | GetSiteInformationParams, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformation>>, TError, TData>> & Pick<
export function useGetApiV10SiteInformationInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10SiteInformation>>>, TError = ErrorType<unknown>>(
params: undefined | GetApiV10SiteInformationParams, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getSiteInformation>>,
Awaited<ReturnType<typeof getApiV10SiteInformation>>,
TError,
Awaited<ReturnType<typeof getSiteInformation>>
Awaited<ReturnType<typeof getApiV10SiteInformation>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetSiteInformationInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getSiteInformation>>>, TError = ErrorType<unknown>>(
params?: GetSiteInformationParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformation>>, TError, TData>> & Pick<
export function useGetApiV10SiteInformationInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10SiteInformation>>>, TError = ErrorType<unknown>>(
params?: GetApiV10SiteInformationParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getSiteInformation>>,
Awaited<ReturnType<typeof getApiV10SiteInformation>>,
TError,
Awaited<ReturnType<typeof getSiteInformation>>
Awaited<ReturnType<typeof getApiV10SiteInformation>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetSiteInformationInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getSiteInformation>>>, TError = ErrorType<unknown>>(
params?: GetSiteInformationParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformation>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10SiteInformationInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10SiteInformation>>>, TError = ErrorType<unknown>>(
params?: GetApiV10SiteInformationParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get current site information
*/
export function useGetSiteInformationInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getSiteInformation>>>, TError = ErrorType<unknown>>(
params?: GetSiteInformationParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformation>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10SiteInformationInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10SiteInformation>>>, TError = ErrorType<unknown>>(
params?: GetApiV10SiteInformationParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetSiteInformationInfiniteQueryOptions(params,options)
const queryOptions = getGetApiV10SiteInformationInfiniteQueryOptions(params,options)
const query = useInfiniteQuery(queryOptions, queryClient) as UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -173,12 +173,12 @@ export function useGetSiteInformationInfinite<TData = InfiniteData<Awaited<Retur
/**
* @summary Get current site information
*/
export const prefetchGetSiteInformationInfiniteQuery = async <TData = Awaited<ReturnType<typeof getSiteInformation>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetSiteInformationParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformation>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10SiteInformationInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetApiV10SiteInformationParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetSiteInformationInfiniteQueryOptions(params,options)
const queryOptions = getGetApiV10SiteInformationInfiniteQueryOptions(params,options)
await queryClient.prefetchInfiniteQuery(queryOptions);
......@@ -187,62 +187,62 @@ export const prefetchGetSiteInformationInfiniteQuery = async <TData = Awaited<Re
export const getGetSiteInformationQueryOptions = <TData = Awaited<ReturnType<typeof getSiteInformation>>, TError = ErrorType<unknown>>(params?: GetSiteInformationParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSiteInformation>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10SiteInformationQueryOptions = <TData = Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError = ErrorType<unknown>>(params?: GetApiV10SiteInformationParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetSiteInformationQueryKey(params);
const queryKey = queryOptions?.queryKey ?? getGetApiV10SiteInformationQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getSiteInformation>>> = ({ signal }) => getSiteInformation(params, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10SiteInformation>>> = ({ signal }) => getApiV10SiteInformation(params, { signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getSiteInformation>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetSiteInformationQueryResult = NonNullable<Awaited<ReturnType<typeof getSiteInformation>>>
export type GetSiteInformationQueryError = ErrorType<unknown>
export type GetApiV10SiteInformationQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10SiteInformation>>>
export type GetApiV10SiteInformationQueryError = ErrorType<unknown>
export function useGetSiteInformation<TData = Awaited<ReturnType<typeof getSiteInformation>>, TError = ErrorType<unknown>>(
params: undefined | GetSiteInformationParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSiteInformation>>, TError, TData>> & Pick<
export function useGetApiV10SiteInformation<TData = Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError = ErrorType<unknown>>(
params: undefined | GetApiV10SiteInformationParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getSiteInformation>>,
Awaited<ReturnType<typeof getApiV10SiteInformation>>,
TError,
Awaited<ReturnType<typeof getSiteInformation>>
Awaited<ReturnType<typeof getApiV10SiteInformation>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetSiteInformation<TData = Awaited<ReturnType<typeof getSiteInformation>>, TError = ErrorType<unknown>>(
params?: GetSiteInformationParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSiteInformation>>, TError, TData>> & Pick<
export function useGetApiV10SiteInformation<TData = Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError = ErrorType<unknown>>(
params?: GetApiV10SiteInformationParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getSiteInformation>>,
Awaited<ReturnType<typeof getApiV10SiteInformation>>,
TError,
Awaited<ReturnType<typeof getSiteInformation>>
Awaited<ReturnType<typeof getApiV10SiteInformation>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetSiteInformation<TData = Awaited<ReturnType<typeof getSiteInformation>>, TError = ErrorType<unknown>>(
params?: GetSiteInformationParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSiteInformation>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10SiteInformation<TData = Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError = ErrorType<unknown>>(
params?: GetApiV10SiteInformationParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get current site information
*/
export function useGetSiteInformation<TData = Awaited<ReturnType<typeof getSiteInformation>>, TError = ErrorType<unknown>>(
params?: GetSiteInformationParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSiteInformation>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10SiteInformation<TData = Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError = ErrorType<unknown>>(
params?: GetApiV10SiteInformationParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetSiteInformationQueryOptions(params,options)
const queryOptions = getGetApiV10SiteInformationQueryOptions(params,options)
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -254,12 +254,12 @@ export function useGetSiteInformation<TData = Awaited<ReturnType<typeof getSiteI
/**
* @summary Get current site information
*/
export const prefetchGetSiteInformationQuery = async <TData = Awaited<ReturnType<typeof getSiteInformation>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetSiteInformationParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSiteInformation>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10SiteInformationQuery = async <TData = Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetApiV10SiteInformationParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformation>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetSiteInformationQueryOptions(params,options)
const queryOptions = getGetApiV10SiteInformationQueryOptions(params,options)
await queryClient.prefetchQuery(queryOptions);
......@@ -272,41 +272,41 @@ export const prefetchGetSiteInformationQuery = async <TData = Awaited<ReturnType
* Update current site information configuration
* @summary Update current site information
*/
export type putSiteInformationResponse200 = {
data: PutSiteInformation200
export type putApiV10SiteInformationResponse200 = {
data: PutApiV10SiteInformation200
status: 200
}
export type putSiteInformationResponse400 = {
export type putApiV10SiteInformationResponse400 = {
data: void
status: 400
}
export type putSiteInformationResponse401 = {
export type putApiV10SiteInformationResponse401 = {
data: void
status: 401
}
export type putSiteInformationResponseSuccess = (putSiteInformationResponse200) & {
export type putApiV10SiteInformationResponseSuccess = (putApiV10SiteInformationResponse200) & {
headers: Headers;
};
export type putSiteInformationResponseError = (putSiteInformationResponse400 | putSiteInformationResponse401) & {
export type putApiV10SiteInformationResponseError = (putApiV10SiteInformationResponse400 | putApiV10SiteInformationResponse401) & {
headers: Headers;
};
export type putSiteInformationResponse = (putSiteInformationResponseSuccess | putSiteInformationResponseError)
export type putApiV10SiteInformationResponse = (putApiV10SiteInformationResponseSuccess | putApiV10SiteInformationResponseError)
export const getPutSiteInformationUrl = () => {
export const getPutApiV10SiteInformationUrl = () => {
return `/siteInformation`
return `/api/v1.0/siteInformation`
}
export const putSiteInformation = async (siteInformationUpdateBody: SiteInformationUpdateBody, options?: RequestInit): Promise<putSiteInformationResponse> => {
export const putApiV10SiteInformation = async (siteInformationUpdateBody: SiteInformationUpdateBody, options?: RequestInit): Promise<putApiV10SiteInformationResponse> => {
return useCustomClient<putSiteInformationResponse>(getPutSiteInformationUrl(),
return useCustomClient<putApiV10SiteInformationResponse>(getPutApiV10SiteInformationUrl(),
{
...options,
method: 'PUT',
......@@ -319,11 +319,11 @@ export const putSiteInformation = async (siteInformationUpdateBody: SiteInformat
export const getPutSiteInformationMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putSiteInformation>>, TError,{data: BodyType<SiteInformationUpdateBody>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof putSiteInformation>>, TError,{data: BodyType<SiteInformationUpdateBody>}, TContext> => {
export const getPutApiV10SiteInformationMutationOptions = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putApiV10SiteInformation>>, TError,{data: BodyType<SiteInformationUpdateBody>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof putApiV10SiteInformation>>, TError,{data: BodyType<SiteInformationUpdateBody>}, TContext> => {
const mutationKey = ['putSiteInformation'];
const mutationKey = ['putApiV10SiteInformation'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -333,10 +333,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof putSiteInformation>>, {data: BodyType<SiteInformationUpdateBody>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof putApiV10SiteInformation>>, {data: BodyType<SiteInformationUpdateBody>}> = (props) => {
const {data} = props ?? {};
return putSiteInformation(data,requestOptions)
return putApiV10SiteInformation(data,requestOptions)
}
......@@ -344,53 +344,53 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PutSiteInformationMutationResult = NonNullable<Awaited<ReturnType<typeof putSiteInformation>>>
export type PutSiteInformationMutationBody = BodyType<SiteInformationUpdateBody>
export type PutSiteInformationMutationError = ErrorType<void>
export type PutApiV10SiteInformationMutationResult = NonNullable<Awaited<ReturnType<typeof putApiV10SiteInformation>>>
export type PutApiV10SiteInformationMutationBody = BodyType<SiteInformationUpdateBody>
export type PutApiV10SiteInformationMutationError = ErrorType<void>
/**
* @summary Update current site information
*/
export const usePutSiteInformation = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putSiteInformation>>, TError,{data: BodyType<SiteInformationUpdateBody>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePutApiV10SiteInformation = <TError = ErrorType<void>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putApiV10SiteInformation>>, TError,{data: BodyType<SiteInformationUpdateBody>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof putSiteInformation>>,
Awaited<ReturnType<typeof putApiV10SiteInformation>>,
TError,
{data: BodyType<SiteInformationUpdateBody>},
TContext
> => {
const mutationOptions = getPutSiteInformationMutationOptions(options);
const mutationOptions = getPutApiV10SiteInformationMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
/**
* @summary Update fixed site social link
*/
export type patchSiteInformationSocialsIdResponse200 = {
export type patchApiV10SiteInformationSocialsIdResponse200 = {
data: void
status: 200
}
export type patchSiteInformationSocialsIdResponseSuccess = (patchSiteInformationSocialsIdResponse200) & {
export type patchApiV10SiteInformationSocialsIdResponseSuccess = (patchApiV10SiteInformationSocialsIdResponse200) & {
headers: Headers;
};
;
export type patchSiteInformationSocialsIdResponse = (patchSiteInformationSocialsIdResponseSuccess)
export type patchApiV10SiteInformationSocialsIdResponse = (patchApiV10SiteInformationSocialsIdResponseSuccess)
export const getPatchSiteInformationSocialsIdUrl = (id: string,) => {
export const getPatchApiV10SiteInformationSocialsIdUrl = (id: string,) => {
return `/siteInformation/socials/${id}`
return `/api/v1.0/siteInformation/socials/${id}`
}
export const patchSiteInformationSocialsId = async (id: string,
siteInformationSocialMutate: SiteInformationSocialMutate, options?: RequestInit): Promise<patchSiteInformationSocialsIdResponse> => {
export const patchApiV10SiteInformationSocialsId = async (id: string,
siteInformationSocialMutate: SiteInformationSocialMutate, options?: RequestInit): Promise<patchApiV10SiteInformationSocialsIdResponse> => {
return useCustomClient<patchSiteInformationSocialsIdResponse>(getPatchSiteInformationSocialsIdUrl(id),
return useCustomClient<patchApiV10SiteInformationSocialsIdResponse>(getPatchApiV10SiteInformationSocialsIdUrl(id),
{
...options,
method: 'PATCH',
......@@ -403,11 +403,11 @@ export const patchSiteInformationSocialsId = async (id: string,
export const getPatchSiteInformationSocialsIdMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchSiteInformationSocialsId>>, TError,{id: string;data: BodyType<SiteInformationSocialMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof patchSiteInformationSocialsId>>, TError,{id: string;data: BodyType<SiteInformationSocialMutate>}, TContext> => {
export const getPatchApiV10SiteInformationSocialsIdMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchApiV10SiteInformationSocialsId>>, TError,{id: string;data: BodyType<SiteInformationSocialMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof patchApiV10SiteInformationSocialsId>>, TError,{id: string;data: BodyType<SiteInformationSocialMutate>}, TContext> => {
const mutationKey = ['patchSiteInformationSocialsId'];
const mutationKey = ['patchApiV10SiteInformationSocialsId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -417,10 +417,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchSiteInformationSocialsId>>, {id: string;data: BodyType<SiteInformationSocialMutate>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchApiV10SiteInformationSocialsId>>, {id: string;data: BodyType<SiteInformationSocialMutate>}> = (props) => {
const {id,data} = props ?? {};
return patchSiteInformationSocialsId(id,data,requestOptions)
return patchApiV10SiteInformationSocialsId(id,data,requestOptions)
}
......@@ -428,52 +428,52 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PatchSiteInformationSocialsIdMutationResult = NonNullable<Awaited<ReturnType<typeof patchSiteInformationSocialsId>>>
export type PatchSiteInformationSocialsIdMutationBody = BodyType<SiteInformationSocialMutate>
export type PatchSiteInformationSocialsIdMutationError = ErrorType<unknown>
export type PatchApiV10SiteInformationSocialsIdMutationResult = NonNullable<Awaited<ReturnType<typeof patchApiV10SiteInformationSocialsId>>>
export type PatchApiV10SiteInformationSocialsIdMutationBody = BodyType<SiteInformationSocialMutate>
export type PatchApiV10SiteInformationSocialsIdMutationError = ErrorType<unknown>
/**
* @summary Update fixed site social link
*/
export const usePatchSiteInformationSocialsId = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchSiteInformationSocialsId>>, TError,{id: string;data: BodyType<SiteInformationSocialMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePatchApiV10SiteInformationSocialsId = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchApiV10SiteInformationSocialsId>>, TError,{id: string;data: BodyType<SiteInformationSocialMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof patchSiteInformationSocialsId>>,
Awaited<ReturnType<typeof patchApiV10SiteInformationSocialsId>>,
TError,
{id: string;data: BodyType<SiteInformationSocialMutate>},
TContext
> => {
const mutationOptions = getPatchSiteInformationSocialsIdMutationOptions(options);
const mutationOptions = getPatchApiV10SiteInformationSocialsIdMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
/**
* @summary Get fixed site social links
*/
export type getSiteInformationSocialsResponse200 = {
export type getApiV10SiteInformationSocialsResponse200 = {
data: void
status: 200
}
export type getSiteInformationSocialsResponseSuccess = (getSiteInformationSocialsResponse200) & {
export type getApiV10SiteInformationSocialsResponseSuccess = (getApiV10SiteInformationSocialsResponse200) & {
headers: Headers;
};
;
export type getSiteInformationSocialsResponse = (getSiteInformationSocialsResponseSuccess)
export type getApiV10SiteInformationSocialsResponse = (getApiV10SiteInformationSocialsResponseSuccess)
export const getGetSiteInformationSocialsUrl = () => {
export const getGetApiV10SiteInformationSocialsUrl = () => {
return `/siteInformation/socials`
return `/api/v1.0/siteInformation/socials`
}
export const getSiteInformationSocials = async ( options?: RequestInit): Promise<getSiteInformationSocialsResponse> => {
export const getApiV10SiteInformationSocials = async ( options?: RequestInit): Promise<getApiV10SiteInformationSocialsResponse> => {
return useCustomClient<getSiteInformationSocialsResponse>(getGetSiteInformationSocialsUrl(),
return useCustomClient<getApiV10SiteInformationSocialsResponse>(getGetApiV10SiteInformationSocialsUrl(),
{
...options,
method: 'GET'
......@@ -486,75 +486,75 @@ export const getSiteInformationSocials = async ( options?: RequestInit): Promise
export const getGetSiteInformationSocialsInfiniteQueryKey = () => {
export const getGetApiV10SiteInformationSocialsInfiniteQueryKey = () => {
return [
'infinite', `/siteInformation/socials`
'infinite', `/api/v1.0/siteInformation/socials`
] as const;
}
export const getGetSiteInformationSocialsQueryKey = () => {
export const getGetApiV10SiteInformationSocialsQueryKey = () => {
return [
`/siteInformation/socials`
`/api/v1.0/siteInformation/socials`
] as const;
}
export const getGetSiteInformationSocialsInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getSiteInformationSocials>>>, TError = ErrorType<unknown>>( options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformationSocials>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10SiteInformationSocialsInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>>, TError = ErrorType<unknown>>( options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetSiteInformationSocialsInfiniteQueryKey();
const queryKey = queryOptions?.queryKey ?? getGetApiV10SiteInformationSocialsInfiniteQueryKey();
const queryFn: QueryFunction<Awaited<ReturnType<typeof getSiteInformationSocials>>> = ({ signal }) => getSiteInformationSocials({ signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>> = ({ signal }) => getApiV10SiteInformationSocials({ signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformationSocials>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetSiteInformationSocialsInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getSiteInformationSocials>>>
export type GetSiteInformationSocialsInfiniteQueryError = ErrorType<unknown>
export type GetApiV10SiteInformationSocialsInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>>
export type GetApiV10SiteInformationSocialsInfiniteQueryError = ErrorType<unknown>
export function useGetSiteInformationSocialsInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getSiteInformationSocials>>>, TError = ErrorType<unknown>>(
options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformationSocials>>, TError, TData>> & Pick<
export function useGetApiV10SiteInformationSocialsInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>>, TError = ErrorType<unknown>>(
options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getSiteInformationSocials>>,
Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>,
TError,
Awaited<ReturnType<typeof getSiteInformationSocials>>
Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetSiteInformationSocialsInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getSiteInformationSocials>>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformationSocials>>, TError, TData>> & Pick<
export function useGetApiV10SiteInformationSocialsInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getSiteInformationSocials>>,
Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>,
TError,
Awaited<ReturnType<typeof getSiteInformationSocials>>
Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetSiteInformationSocialsInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getSiteInformationSocials>>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformationSocials>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10SiteInformationSocialsInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get fixed site social links
*/
export function useGetSiteInformationSocialsInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getSiteInformationSocials>>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformationSocials>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10SiteInformationSocialsInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetSiteInformationSocialsInfiniteQueryOptions(options)
const queryOptions = getGetApiV10SiteInformationSocialsInfiniteQueryOptions(options)
const query = useInfiniteQuery(queryOptions, queryClient) as UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -566,12 +566,12 @@ export function useGetSiteInformationSocialsInfinite<TData = InfiniteData<Awaite
/**
* @summary Get fixed site social links
*/
export const prefetchGetSiteInformationSocialsInfiniteQuery = async <TData = Awaited<ReturnType<typeof getSiteInformationSocials>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformationSocials>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10SiteInformationSocialsInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetSiteInformationSocialsInfiniteQueryOptions(options)
const queryOptions = getGetApiV10SiteInformationSocialsInfiniteQueryOptions(options)
await queryClient.prefetchInfiniteQuery(queryOptions);
......@@ -580,62 +580,62 @@ export const prefetchGetSiteInformationSocialsInfiniteQuery = async <TData = Awa
export const getGetSiteInformationSocialsQueryOptions = <TData = Awaited<ReturnType<typeof getSiteInformationSocials>>, TError = ErrorType<unknown>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSiteInformationSocials>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10SiteInformationSocialsQueryOptions = <TData = Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError = ErrorType<unknown>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetSiteInformationSocialsQueryKey();
const queryKey = queryOptions?.queryKey ?? getGetApiV10SiteInformationSocialsQueryKey();
const queryFn: QueryFunction<Awaited<ReturnType<typeof getSiteInformationSocials>>> = ({ signal }) => getSiteInformationSocials({ signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>> = ({ signal }) => getApiV10SiteInformationSocials({ signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getSiteInformationSocials>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetSiteInformationSocialsQueryResult = NonNullable<Awaited<ReturnType<typeof getSiteInformationSocials>>>
export type GetSiteInformationSocialsQueryError = ErrorType<unknown>
export type GetApiV10SiteInformationSocialsQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>>
export type GetApiV10SiteInformationSocialsQueryError = ErrorType<unknown>
export function useGetSiteInformationSocials<TData = Awaited<ReturnType<typeof getSiteInformationSocials>>, TError = ErrorType<unknown>>(
options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSiteInformationSocials>>, TError, TData>> & Pick<
export function useGetApiV10SiteInformationSocials<TData = Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError = ErrorType<unknown>>(
options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getSiteInformationSocials>>,
Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>,
TError,
Awaited<ReturnType<typeof getSiteInformationSocials>>
Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetSiteInformationSocials<TData = Awaited<ReturnType<typeof getSiteInformationSocials>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSiteInformationSocials>>, TError, TData>> & Pick<
export function useGetApiV10SiteInformationSocials<TData = Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getSiteInformationSocials>>,
Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>,
TError,
Awaited<ReturnType<typeof getSiteInformationSocials>>
Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetSiteInformationSocials<TData = Awaited<ReturnType<typeof getSiteInformationSocials>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSiteInformationSocials>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10SiteInformationSocials<TData = Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get fixed site social links
*/
export function useGetSiteInformationSocials<TData = Awaited<ReturnType<typeof getSiteInformationSocials>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSiteInformationSocials>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10SiteInformationSocials<TData = Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetSiteInformationSocialsQueryOptions(options)
const queryOptions = getGetApiV10SiteInformationSocialsQueryOptions(options)
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -647,12 +647,12 @@ export function useGetSiteInformationSocials<TData = Awaited<ReturnType<typeof g
/**
* @summary Get fixed site social links
*/
export const prefetchGetSiteInformationSocialsQuery = async <TData = Awaited<ReturnType<typeof getSiteInformationSocials>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSiteInformationSocials>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10SiteInformationSocialsQuery = async <TData = Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationSocials>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetSiteInformationSocialsQueryOptions(options)
const queryOptions = getGetApiV10SiteInformationSocialsQueryOptions(options)
await queryClient.prefetchQuery(queryOptions);
......@@ -664,30 +664,30 @@ export const prefetchGetSiteInformationSocialsQuery = async <TData = Awaited<Ret
/**
* @summary Update site information branch
*/
export type patchSiteInformationBranchesIdResponse200 = {
export type patchApiV10SiteInformationBranchesIdResponse200 = {
data: void
status: 200
}
export type patchSiteInformationBranchesIdResponseSuccess = (patchSiteInformationBranchesIdResponse200) & {
export type patchApiV10SiteInformationBranchesIdResponseSuccess = (patchApiV10SiteInformationBranchesIdResponse200) & {
headers: Headers;
};
;
export type patchSiteInformationBranchesIdResponse = (patchSiteInformationBranchesIdResponseSuccess)
export type patchApiV10SiteInformationBranchesIdResponse = (patchApiV10SiteInformationBranchesIdResponseSuccess)
export const getPatchSiteInformationBranchesIdUrl = (id: string,) => {
export const getPatchApiV10SiteInformationBranchesIdUrl = (id: string,) => {
return `/siteInformation/branches/${id}`
return `/api/v1.0/siteInformation/branches/${id}`
}
export const patchSiteInformationBranchesId = async (id: string,
siteInformationBranchMutate: SiteInformationBranchMutate, options?: RequestInit): Promise<patchSiteInformationBranchesIdResponse> => {
export const patchApiV10SiteInformationBranchesId = async (id: string,
siteInformationBranchMutate: SiteInformationBranchMutate, options?: RequestInit): Promise<patchApiV10SiteInformationBranchesIdResponse> => {
return useCustomClient<patchSiteInformationBranchesIdResponse>(getPatchSiteInformationBranchesIdUrl(id),
return useCustomClient<patchApiV10SiteInformationBranchesIdResponse>(getPatchApiV10SiteInformationBranchesIdUrl(id),
{
...options,
method: 'PATCH',
......@@ -700,11 +700,11 @@ export const patchSiteInformationBranchesId = async (id: string,
export const getPatchSiteInformationBranchesIdMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchSiteInformationBranchesId>>, TError,{id: string;data: BodyType<SiteInformationBranchMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof patchSiteInformationBranchesId>>, TError,{id: string;data: BodyType<SiteInformationBranchMutate>}, TContext> => {
export const getPatchApiV10SiteInformationBranchesIdMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchApiV10SiteInformationBranchesId>>, TError,{id: string;data: BodyType<SiteInformationBranchMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof patchApiV10SiteInformationBranchesId>>, TError,{id: string;data: BodyType<SiteInformationBranchMutate>}, TContext> => {
const mutationKey = ['patchSiteInformationBranchesId'];
const mutationKey = ['patchApiV10SiteInformationBranchesId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -714,10 +714,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchSiteInformationBranchesId>>, {id: string;data: BodyType<SiteInformationBranchMutate>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchApiV10SiteInformationBranchesId>>, {id: string;data: BodyType<SiteInformationBranchMutate>}> = (props) => {
const {id,data} = props ?? {};
return patchSiteInformationBranchesId(id,data,requestOptions)
return patchApiV10SiteInformationBranchesId(id,data,requestOptions)
}
......@@ -725,52 +725,52 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PatchSiteInformationBranchesIdMutationResult = NonNullable<Awaited<ReturnType<typeof patchSiteInformationBranchesId>>>
export type PatchSiteInformationBranchesIdMutationBody = BodyType<SiteInformationBranchMutate>
export type PatchSiteInformationBranchesIdMutationError = ErrorType<unknown>
export type PatchApiV10SiteInformationBranchesIdMutationResult = NonNullable<Awaited<ReturnType<typeof patchApiV10SiteInformationBranchesId>>>
export type PatchApiV10SiteInformationBranchesIdMutationBody = BodyType<SiteInformationBranchMutate>
export type PatchApiV10SiteInformationBranchesIdMutationError = ErrorType<unknown>
/**
* @summary Update site information branch
*/
export const usePatchSiteInformationBranchesId = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchSiteInformationBranchesId>>, TError,{id: string;data: BodyType<SiteInformationBranchMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePatchApiV10SiteInformationBranchesId = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchApiV10SiteInformationBranchesId>>, TError,{id: string;data: BodyType<SiteInformationBranchMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof patchSiteInformationBranchesId>>,
Awaited<ReturnType<typeof patchApiV10SiteInformationBranchesId>>,
TError,
{id: string;data: BodyType<SiteInformationBranchMutate>},
TContext
> => {
const mutationOptions = getPatchSiteInformationBranchesIdMutationOptions(options);
const mutationOptions = getPatchApiV10SiteInformationBranchesIdMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
/**
* @summary Delete site information branch
*/
export type deleteSiteInformationBranchesIdResponse200 = {
export type deleteApiV10SiteInformationBranchesIdResponse200 = {
data: void
status: 200
}
export type deleteSiteInformationBranchesIdResponseSuccess = (deleteSiteInformationBranchesIdResponse200) & {
export type deleteApiV10SiteInformationBranchesIdResponseSuccess = (deleteApiV10SiteInformationBranchesIdResponse200) & {
headers: Headers;
};
;
export type deleteSiteInformationBranchesIdResponse = (deleteSiteInformationBranchesIdResponseSuccess)
export type deleteApiV10SiteInformationBranchesIdResponse = (deleteApiV10SiteInformationBranchesIdResponseSuccess)
export const getDeleteSiteInformationBranchesIdUrl = (id: string,) => {
export const getDeleteApiV10SiteInformationBranchesIdUrl = (id: string,) => {
return `/siteInformation/branches/${id}`
return `/api/v1.0/siteInformation/branches/${id}`
}
export const deleteSiteInformationBranchesId = async (id: string, options?: RequestInit): Promise<deleteSiteInformationBranchesIdResponse> => {
export const deleteApiV10SiteInformationBranchesId = async (id: string, options?: RequestInit): Promise<deleteApiV10SiteInformationBranchesIdResponse> => {
return useCustomClient<deleteSiteInformationBranchesIdResponse>(getDeleteSiteInformationBranchesIdUrl(id),
return useCustomClient<deleteApiV10SiteInformationBranchesIdResponse>(getDeleteApiV10SiteInformationBranchesIdUrl(id),
{
...options,
method: 'DELETE'
......@@ -782,11 +782,11 @@ export const deleteSiteInformationBranchesId = async (id: string, options?: Requ
export const getDeleteSiteInformationBranchesIdMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteSiteInformationBranchesId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof deleteSiteInformationBranchesId>>, TError,{id: string}, TContext> => {
export const getDeleteApiV10SiteInformationBranchesIdMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10SiteInformationBranchesId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10SiteInformationBranchesId>>, TError,{id: string}, TContext> => {
const mutationKey = ['deleteSiteInformationBranchesId'];
const mutationKey = ['deleteApiV10SiteInformationBranchesId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -796,10 +796,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteSiteInformationBranchesId>>, {id: string}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteApiV10SiteInformationBranchesId>>, {id: string}> = (props) => {
const {id} = props ?? {};
return deleteSiteInformationBranchesId(id,requestOptions)
return deleteApiV10SiteInformationBranchesId(id,requestOptions)
}
......@@ -807,52 +807,52 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type DeleteSiteInformationBranchesIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteSiteInformationBranchesId>>>
export type DeleteApiV10SiteInformationBranchesIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteApiV10SiteInformationBranchesId>>>
export type DeleteSiteInformationBranchesIdMutationError = ErrorType<unknown>
export type DeleteApiV10SiteInformationBranchesIdMutationError = ErrorType<unknown>
/**
* @summary Delete site information branch
*/
export const useDeleteSiteInformationBranchesId = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteSiteInformationBranchesId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const useDeleteApiV10SiteInformationBranchesId = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10SiteInformationBranchesId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof deleteSiteInformationBranchesId>>,
Awaited<ReturnType<typeof deleteApiV10SiteInformationBranchesId>>,
TError,
{id: string},
TContext
> => {
const mutationOptions = getDeleteSiteInformationBranchesIdMutationOptions(options);
const mutationOptions = getDeleteApiV10SiteInformationBranchesIdMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
/**
* @summary Get site information branches
*/
export type getSiteInformationBranchesResponse200 = {
export type getApiV10SiteInformationBranchesResponse200 = {
data: void
status: 200
}
export type getSiteInformationBranchesResponseSuccess = (getSiteInformationBranchesResponse200) & {
export type getApiV10SiteInformationBranchesResponseSuccess = (getApiV10SiteInformationBranchesResponse200) & {
headers: Headers;
};
;
export type getSiteInformationBranchesResponse = (getSiteInformationBranchesResponseSuccess)
export type getApiV10SiteInformationBranchesResponse = (getApiV10SiteInformationBranchesResponseSuccess)
export const getGetSiteInformationBranchesUrl = () => {
export const getGetApiV10SiteInformationBranchesUrl = () => {
return `/siteInformation/branches`
return `/api/v1.0/siteInformation/branches`
}
export const getSiteInformationBranches = async ( options?: RequestInit): Promise<getSiteInformationBranchesResponse> => {
export const getApiV10SiteInformationBranches = async ( options?: RequestInit): Promise<getApiV10SiteInformationBranchesResponse> => {
return useCustomClient<getSiteInformationBranchesResponse>(getGetSiteInformationBranchesUrl(),
return useCustomClient<getApiV10SiteInformationBranchesResponse>(getGetApiV10SiteInformationBranchesUrl(),
{
...options,
method: 'GET'
......@@ -865,75 +865,75 @@ export const getSiteInformationBranches = async ( options?: RequestInit): Promis
export const getGetSiteInformationBranchesInfiniteQueryKey = () => {
export const getGetApiV10SiteInformationBranchesInfiniteQueryKey = () => {
return [
'infinite', `/siteInformation/branches`
'infinite', `/api/v1.0/siteInformation/branches`
] as const;
}
export const getGetSiteInformationBranchesQueryKey = () => {
export const getGetApiV10SiteInformationBranchesQueryKey = () => {
return [
`/siteInformation/branches`
`/api/v1.0/siteInformation/branches`
] as const;
}
export const getGetSiteInformationBranchesInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getSiteInformationBranches>>>, TError = ErrorType<unknown>>( options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformationBranches>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10SiteInformationBranchesInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>>, TError = ErrorType<unknown>>( options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetSiteInformationBranchesInfiniteQueryKey();
const queryKey = queryOptions?.queryKey ?? getGetApiV10SiteInformationBranchesInfiniteQueryKey();
const queryFn: QueryFunction<Awaited<ReturnType<typeof getSiteInformationBranches>>> = ({ signal }) => getSiteInformationBranches({ signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>> = ({ signal }) => getApiV10SiteInformationBranches({ signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformationBranches>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetSiteInformationBranchesInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getSiteInformationBranches>>>
export type GetSiteInformationBranchesInfiniteQueryError = ErrorType<unknown>
export type GetApiV10SiteInformationBranchesInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>>
export type GetApiV10SiteInformationBranchesInfiniteQueryError = ErrorType<unknown>
export function useGetSiteInformationBranchesInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getSiteInformationBranches>>>, TError = ErrorType<unknown>>(
options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformationBranches>>, TError, TData>> & Pick<
export function useGetApiV10SiteInformationBranchesInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>>, TError = ErrorType<unknown>>(
options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getSiteInformationBranches>>,
Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>,
TError,
Awaited<ReturnType<typeof getSiteInformationBranches>>
Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetSiteInformationBranchesInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getSiteInformationBranches>>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformationBranches>>, TError, TData>> & Pick<
export function useGetApiV10SiteInformationBranchesInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getSiteInformationBranches>>,
Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>,
TError,
Awaited<ReturnType<typeof getSiteInformationBranches>>
Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetSiteInformationBranchesInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getSiteInformationBranches>>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformationBranches>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10SiteInformationBranchesInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get site information branches
*/
export function useGetSiteInformationBranchesInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getSiteInformationBranches>>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformationBranches>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10SiteInformationBranchesInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetSiteInformationBranchesInfiniteQueryOptions(options)
const queryOptions = getGetApiV10SiteInformationBranchesInfiniteQueryOptions(options)
const query = useInfiniteQuery(queryOptions, queryClient) as UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -945,12 +945,12 @@ export function useGetSiteInformationBranchesInfinite<TData = InfiniteData<Await
/**
* @summary Get site information branches
*/
export const prefetchGetSiteInformationBranchesInfiniteQuery = async <TData = Awaited<ReturnType<typeof getSiteInformationBranches>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getSiteInformationBranches>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10SiteInformationBranchesInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetSiteInformationBranchesInfiniteQueryOptions(options)
const queryOptions = getGetApiV10SiteInformationBranchesInfiniteQueryOptions(options)
await queryClient.prefetchInfiniteQuery(queryOptions);
......@@ -959,62 +959,62 @@ export const prefetchGetSiteInformationBranchesInfiniteQuery = async <TData = Aw
export const getGetSiteInformationBranchesQueryOptions = <TData = Awaited<ReturnType<typeof getSiteInformationBranches>>, TError = ErrorType<unknown>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSiteInformationBranches>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10SiteInformationBranchesQueryOptions = <TData = Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError = ErrorType<unknown>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetSiteInformationBranchesQueryKey();
const queryKey = queryOptions?.queryKey ?? getGetApiV10SiteInformationBranchesQueryKey();
const queryFn: QueryFunction<Awaited<ReturnType<typeof getSiteInformationBranches>>> = ({ signal }) => getSiteInformationBranches({ signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>> = ({ signal }) => getApiV10SiteInformationBranches({ signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getSiteInformationBranches>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetSiteInformationBranchesQueryResult = NonNullable<Awaited<ReturnType<typeof getSiteInformationBranches>>>
export type GetSiteInformationBranchesQueryError = ErrorType<unknown>
export type GetApiV10SiteInformationBranchesQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>>
export type GetApiV10SiteInformationBranchesQueryError = ErrorType<unknown>
export function useGetSiteInformationBranches<TData = Awaited<ReturnType<typeof getSiteInformationBranches>>, TError = ErrorType<unknown>>(
options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSiteInformationBranches>>, TError, TData>> & Pick<
export function useGetApiV10SiteInformationBranches<TData = Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError = ErrorType<unknown>>(
options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getSiteInformationBranches>>,
Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>,
TError,
Awaited<ReturnType<typeof getSiteInformationBranches>>
Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetSiteInformationBranches<TData = Awaited<ReturnType<typeof getSiteInformationBranches>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSiteInformationBranches>>, TError, TData>> & Pick<
export function useGetApiV10SiteInformationBranches<TData = Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getSiteInformationBranches>>,
Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>,
TError,
Awaited<ReturnType<typeof getSiteInformationBranches>>
Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetSiteInformationBranches<TData = Awaited<ReturnType<typeof getSiteInformationBranches>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSiteInformationBranches>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10SiteInformationBranches<TData = Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get site information branches
*/
export function useGetSiteInformationBranches<TData = Awaited<ReturnType<typeof getSiteInformationBranches>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSiteInformationBranches>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10SiteInformationBranches<TData = Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError = ErrorType<unknown>>(
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetSiteInformationBranchesQueryOptions(options)
const queryOptions = getGetApiV10SiteInformationBranchesQueryOptions(options)
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -1026,12 +1026,12 @@ export function useGetSiteInformationBranches<TData = Awaited<ReturnType<typeof
/**
* @summary Get site information branches
*/
export const prefetchGetSiteInformationBranchesQuery = async <TData = Awaited<ReturnType<typeof getSiteInformationBranches>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSiteInformationBranches>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10SiteInformationBranchesQuery = async <TData = Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10SiteInformationBranches>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetSiteInformationBranchesQueryOptions(options)
const queryOptions = getGetApiV10SiteInformationBranchesQueryOptions(options)
await queryClient.prefetchQuery(queryOptions);
......@@ -1043,29 +1043,29 @@ export const prefetchGetSiteInformationBranchesQuery = async <TData = Awaited<Re
/**
* @summary Create site information branch
*/
export type postSiteInformationBranchesResponse200 = {
export type postApiV10SiteInformationBranchesResponse200 = {
data: void
status: 200
}
export type postSiteInformationBranchesResponseSuccess = (postSiteInformationBranchesResponse200) & {
export type postApiV10SiteInformationBranchesResponseSuccess = (postApiV10SiteInformationBranchesResponse200) & {
headers: Headers;
};
;
export type postSiteInformationBranchesResponse = (postSiteInformationBranchesResponseSuccess)
export type postApiV10SiteInformationBranchesResponse = (postApiV10SiteInformationBranchesResponseSuccess)
export const getPostSiteInformationBranchesUrl = () => {
export const getPostApiV10SiteInformationBranchesUrl = () => {
return `/siteInformation/branches`
return `/api/v1.0/siteInformation/branches`
}
export const postSiteInformationBranches = async (siteInformationBranchMutate: SiteInformationBranchMutate, options?: RequestInit): Promise<postSiteInformationBranchesResponse> => {
export const postApiV10SiteInformationBranches = async (siteInformationBranchMutate: SiteInformationBranchMutate, options?: RequestInit): Promise<postApiV10SiteInformationBranchesResponse> => {
return useCustomClient<postSiteInformationBranchesResponse>(getPostSiteInformationBranchesUrl(),
return useCustomClient<postApiV10SiteInformationBranchesResponse>(getPostApiV10SiteInformationBranchesUrl(),
{
...options,
method: 'POST',
......@@ -1078,11 +1078,11 @@ export const postSiteInformationBranches = async (siteInformationBranchMutate: S
export const getPostSiteInformationBranchesMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postSiteInformationBranches>>, TError,{data: BodyType<SiteInformationBranchMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postSiteInformationBranches>>, TError,{data: BodyType<SiteInformationBranchMutate>}, TContext> => {
export const getPostApiV10SiteInformationBranchesMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postApiV10SiteInformationBranches>>, TError,{data: BodyType<SiteInformationBranchMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postApiV10SiteInformationBranches>>, TError,{data: BodyType<SiteInformationBranchMutate>}, TContext> => {
const mutationKey = ['postSiteInformationBranches'];
const mutationKey = ['postApiV10SiteInformationBranches'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -1092,10 +1092,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof postSiteInformationBranches>>, {data: BodyType<SiteInformationBranchMutate>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof postApiV10SiteInformationBranches>>, {data: BodyType<SiteInformationBranchMutate>}> = (props) => {
const {data} = props ?? {};
return postSiteInformationBranches(data,requestOptions)
return postApiV10SiteInformationBranches(data,requestOptions)
}
......@@ -1103,23 +1103,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PostSiteInformationBranchesMutationResult = NonNullable<Awaited<ReturnType<typeof postSiteInformationBranches>>>
export type PostSiteInformationBranchesMutationBody = BodyType<SiteInformationBranchMutate>
export type PostSiteInformationBranchesMutationError = ErrorType<unknown>
export type PostApiV10SiteInformationBranchesMutationResult = NonNullable<Awaited<ReturnType<typeof postApiV10SiteInformationBranches>>>
export type PostApiV10SiteInformationBranchesMutationBody = BodyType<SiteInformationBranchMutate>
export type PostApiV10SiteInformationBranchesMutationError = ErrorType<unknown>
/**
* @summary Create site information branch
*/
export const usePostSiteInformationBranches = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postSiteInformationBranches>>, TError,{data: BodyType<SiteInformationBranchMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePostApiV10SiteInformationBranches = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postApiV10SiteInformationBranches>>, TError,{data: BodyType<SiteInformationBranchMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof postSiteInformationBranches>>,
Awaited<ReturnType<typeof postApiV10SiteInformationBranches>>,
TError,
{data: BodyType<SiteInformationBranchMutate>},
TContext
> => {
const mutationOptions = getPostSiteInformationBranchesMutationOptions(options);
const mutationOptions = getPostApiV10SiteInformationBranchesMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import {
......@@ -30,10 +30,10 @@ import type {
} from '@tanstack/react-query';
import type {
GetVideoId200,
GetVideoParams,
PatchVideoId200,
PostVideo200,
GetApiV10VideoId200,
GetApiV10VideoParams,
PatchApiV10VideoId200,
PostApiV10Video200,
ResponseGetAllData,
VideoMutate
} from '../models';
......@@ -51,29 +51,29 @@ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
* Retrieve a specific video by its ID
* @summary Get a video by ID
*/
export type getVideoIdResponse200 = {
data: GetVideoId200
export type getApiV10VideoIdResponse200 = {
data: GetApiV10VideoId200
status: 200
}
export type getVideoIdResponseSuccess = (getVideoIdResponse200) & {
export type getApiV10VideoIdResponseSuccess = (getApiV10VideoIdResponse200) & {
headers: Headers;
};
;
export type getVideoIdResponse = (getVideoIdResponseSuccess)
export type getApiV10VideoIdResponse = (getApiV10VideoIdResponseSuccess)
export const getGetVideoIdUrl = (id: string,) => {
export const getGetApiV10VideoIdUrl = (id: string,) => {
return `/video/${id}`
return `/api/v1.0/video/${id}`
}
export const getVideoId = async (id: string, options?: RequestInit): Promise<getVideoIdResponse> => {
export const getApiV10VideoId = async (id: string, options?: RequestInit): Promise<getApiV10VideoIdResponse> => {
return useCustomClient<getVideoIdResponse>(getGetVideoIdUrl(id),
return useCustomClient<getApiV10VideoIdResponse>(getGetApiV10VideoIdUrl(id),
{
...options,
method: 'GET'
......@@ -86,75 +86,75 @@ export const getVideoId = async (id: string, options?: RequestInit): Promise<get
export const getGetVideoIdInfiniteQueryKey = (id?: string,) => {
export const getGetApiV10VideoIdInfiniteQueryKey = (id?: string,) => {
return [
'infinite', `/video/${id}`
'infinite', `/api/v1.0/video/${id}`
] as const;
}
export const getGetVideoIdQueryKey = (id?: string,) => {
export const getGetApiV10VideoIdQueryKey = (id?: string,) => {
return [
`/video/${id}`
`/api/v1.0/video/${id}`
] as const;
}
export const getGetVideoIdInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getVideoId>>>, TError = ErrorType<unknown>>(id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getVideoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10VideoIdInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getApiV10VideoId>>>, TError = ErrorType<unknown>>(id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10VideoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetVideoIdInfiniteQueryKey(id);
const queryKey = queryOptions?.queryKey ?? getGetApiV10VideoIdInfiniteQueryKey(id);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getVideoId>>> = ({ signal }) => getVideoId(id, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10VideoId>>> = ({ signal }) => getApiV10VideoId(id, { signal, ...requestOptions });
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getVideoId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10VideoId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetVideoIdInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getVideoId>>>
export type GetVideoIdInfiniteQueryError = ErrorType<unknown>
export type GetApiV10VideoIdInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10VideoId>>>
export type GetApiV10VideoIdInfiniteQueryError = ErrorType<unknown>
export function useGetVideoIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getVideoId>>>, TError = ErrorType<unknown>>(
id: string, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getVideoId>>, TError, TData>> & Pick<
export function useGetApiV10VideoIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10VideoId>>>, TError = ErrorType<unknown>>(
id: string, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10VideoId>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getVideoId>>,
Awaited<ReturnType<typeof getApiV10VideoId>>,
TError,
Awaited<ReturnType<typeof getVideoId>>
Awaited<ReturnType<typeof getApiV10VideoId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetVideoIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getVideoId>>>, TError = ErrorType<unknown>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getVideoId>>, TError, TData>> & Pick<
export function useGetApiV10VideoIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10VideoId>>>, TError = ErrorType<unknown>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10VideoId>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getVideoId>>,
Awaited<ReturnType<typeof getApiV10VideoId>>,
TError,
Awaited<ReturnType<typeof getVideoId>>
Awaited<ReturnType<typeof getApiV10VideoId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetVideoIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getVideoId>>>, TError = ErrorType<unknown>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getVideoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10VideoIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10VideoId>>>, TError = ErrorType<unknown>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10VideoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get a video by ID
*/
export function useGetVideoIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getVideoId>>>, TError = ErrorType<unknown>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getVideoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10VideoIdInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10VideoId>>>, TError = ErrorType<unknown>>(
id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10VideoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetVideoIdInfiniteQueryOptions(id,options)
const queryOptions = getGetApiV10VideoIdInfiniteQueryOptions(id,options)
const query = useInfiniteQuery(queryOptions, queryClient) as UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -166,12 +166,12 @@ export function useGetVideoIdInfinite<TData = InfiniteData<Awaited<ReturnType<ty
/**
* @summary Get a video by ID
*/
export const prefetchGetVideoIdInfiniteQuery = async <TData = Awaited<ReturnType<typeof getVideoId>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getVideoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10VideoIdInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10VideoId>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10VideoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetVideoIdInfiniteQueryOptions(id,options)
const queryOptions = getGetApiV10VideoIdInfiniteQueryOptions(id,options)
await queryClient.prefetchInfiniteQuery(queryOptions);
......@@ -180,62 +180,62 @@ export const prefetchGetVideoIdInfiniteQuery = async <TData = Awaited<ReturnType
export const getGetVideoIdQueryOptions = <TData = Awaited<ReturnType<typeof getVideoId>>, TError = ErrorType<unknown>>(id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getVideoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10VideoIdQueryOptions = <TData = Awaited<ReturnType<typeof getApiV10VideoId>>, TError = ErrorType<unknown>>(id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10VideoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetVideoIdQueryKey(id);
const queryKey = queryOptions?.queryKey ?? getGetApiV10VideoIdQueryKey(id);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getVideoId>>> = ({ signal }) => getVideoId(id, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10VideoId>>> = ({ signal }) => getApiV10VideoId(id, { signal, ...requestOptions });
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getVideoId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, enabled: !!(id), retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApiV10VideoId>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetVideoIdQueryResult = NonNullable<Awaited<ReturnType<typeof getVideoId>>>
export type GetVideoIdQueryError = ErrorType<unknown>
export type GetApiV10VideoIdQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10VideoId>>>
export type GetApiV10VideoIdQueryError = ErrorType<unknown>
export function useGetVideoId<TData = Awaited<ReturnType<typeof getVideoId>>, TError = ErrorType<unknown>>(
id: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getVideoId>>, TError, TData>> & Pick<
export function useGetApiV10VideoId<TData = Awaited<ReturnType<typeof getApiV10VideoId>>, TError = ErrorType<unknown>>(
id: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10VideoId>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getVideoId>>,
Awaited<ReturnType<typeof getApiV10VideoId>>,
TError,
Awaited<ReturnType<typeof getVideoId>>
Awaited<ReturnType<typeof getApiV10VideoId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetVideoId<TData = Awaited<ReturnType<typeof getVideoId>>, TError = ErrorType<unknown>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getVideoId>>, TError, TData>> & Pick<
export function useGetApiV10VideoId<TData = Awaited<ReturnType<typeof getApiV10VideoId>>, TError = ErrorType<unknown>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10VideoId>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getVideoId>>,
Awaited<ReturnType<typeof getApiV10VideoId>>,
TError,
Awaited<ReturnType<typeof getVideoId>>
Awaited<ReturnType<typeof getApiV10VideoId>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetVideoId<TData = Awaited<ReturnType<typeof getVideoId>>, TError = ErrorType<unknown>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getVideoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10VideoId<TData = Awaited<ReturnType<typeof getApiV10VideoId>>, TError = ErrorType<unknown>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10VideoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get a video by ID
*/
export function useGetVideoId<TData = Awaited<ReturnType<typeof getVideoId>>, TError = ErrorType<unknown>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getVideoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10VideoId<TData = Awaited<ReturnType<typeof getApiV10VideoId>>, TError = ErrorType<unknown>>(
id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10VideoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetVideoIdQueryOptions(id,options)
const queryOptions = getGetApiV10VideoIdQueryOptions(id,options)
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -247,12 +247,12 @@ export function useGetVideoId<TData = Awaited<ReturnType<typeof getVideoId>>, TE
/**
* @summary Get a video by ID
*/
export const prefetchGetVideoIdQuery = async <TData = Awaited<ReturnType<typeof getVideoId>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getVideoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10VideoIdQuery = async <TData = Awaited<ReturnType<typeof getApiV10VideoId>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, id: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10VideoId>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetVideoIdQueryOptions(id,options)
const queryOptions = getGetApiV10VideoIdQueryOptions(id,options)
await queryClient.prefetchQuery(queryOptions);
......@@ -265,30 +265,30 @@ export const prefetchGetVideoIdQuery = async <TData = Awaited<ReturnType<typeof
* Update an existing video record
* @summary Update a video
*/
export type patchVideoIdResponse200 = {
data: PatchVideoId200
export type patchApiV10VideoIdResponse200 = {
data: PatchApiV10VideoId200
status: 200
}
export type patchVideoIdResponseSuccess = (patchVideoIdResponse200) & {
export type patchApiV10VideoIdResponseSuccess = (patchApiV10VideoIdResponse200) & {
headers: Headers;
};
;
export type patchVideoIdResponse = (patchVideoIdResponseSuccess)
export type patchApiV10VideoIdResponse = (patchApiV10VideoIdResponseSuccess)
export const getPatchVideoIdUrl = (id: string,) => {
export const getPatchApiV10VideoIdUrl = (id: string,) => {
return `/video/${id}`
return `/api/v1.0/video/${id}`
}
export const patchVideoId = async (id: string,
videoMutate: VideoMutate, options?: RequestInit): Promise<patchVideoIdResponse> => {
export const patchApiV10VideoId = async (id: string,
videoMutate: VideoMutate, options?: RequestInit): Promise<patchApiV10VideoIdResponse> => {
return useCustomClient<patchVideoIdResponse>(getPatchVideoIdUrl(id),
return useCustomClient<patchApiV10VideoIdResponse>(getPatchApiV10VideoIdUrl(id),
{
...options,
method: 'PATCH',
......@@ -301,11 +301,11 @@ export const patchVideoId = async (id: string,
export const getPatchVideoIdMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchVideoId>>, TError,{id: string;data: BodyType<VideoMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof patchVideoId>>, TError,{id: string;data: BodyType<VideoMutate>}, TContext> => {
export const getPatchApiV10VideoIdMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchApiV10VideoId>>, TError,{id: string;data: BodyType<VideoMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof patchApiV10VideoId>>, TError,{id: string;data: BodyType<VideoMutate>}, TContext> => {
const mutationKey = ['patchVideoId'];
const mutationKey = ['patchApiV10VideoId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -315,10 +315,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchVideoId>>, {id: string;data: BodyType<VideoMutate>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchApiV10VideoId>>, {id: string;data: BodyType<VideoMutate>}> = (props) => {
const {id,data} = props ?? {};
return patchVideoId(id,data,requestOptions)
return patchApiV10VideoId(id,data,requestOptions)
}
......@@ -326,23 +326,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PatchVideoIdMutationResult = NonNullable<Awaited<ReturnType<typeof patchVideoId>>>
export type PatchVideoIdMutationBody = BodyType<VideoMutate>
export type PatchVideoIdMutationError = ErrorType<unknown>
export type PatchApiV10VideoIdMutationResult = NonNullable<Awaited<ReturnType<typeof patchApiV10VideoId>>>
export type PatchApiV10VideoIdMutationBody = BodyType<VideoMutate>
export type PatchApiV10VideoIdMutationError = ErrorType<unknown>
/**
* @summary Update a video
*/
export const usePatchVideoId = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchVideoId>>, TError,{id: string;data: BodyType<VideoMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePatchApiV10VideoId = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchApiV10VideoId>>, TError,{id: string;data: BodyType<VideoMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof patchVideoId>>,
Awaited<ReturnType<typeof patchApiV10VideoId>>,
TError,
{id: string;data: BodyType<VideoMutate>},
TContext
> => {
const mutationOptions = getPatchVideoIdMutationOptions(options);
const mutationOptions = getPatchApiV10VideoIdMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
......@@ -350,30 +350,30 @@ export const usePatchVideoId = <TError = ErrorType<unknown>,
* Replace an existing video record
* @summary Replace a video
*/
export type putVideoIdResponse200 = {
export type putApiV10VideoIdResponse200 = {
data: void
status: 200
}
export type putVideoIdResponseSuccess = (putVideoIdResponse200) & {
export type putApiV10VideoIdResponseSuccess = (putApiV10VideoIdResponse200) & {
headers: Headers;
};
;
export type putVideoIdResponse = (putVideoIdResponseSuccess)
export type putApiV10VideoIdResponse = (putApiV10VideoIdResponseSuccess)
export const getPutVideoIdUrl = (id: string,) => {
export const getPutApiV10VideoIdUrl = (id: string,) => {
return `/video/${id}`
return `/api/v1.0/video/${id}`
}
export const putVideoId = async (id: string,
videoMutate: VideoMutate, options?: RequestInit): Promise<putVideoIdResponse> => {
export const putApiV10VideoId = async (id: string,
videoMutate: VideoMutate, options?: RequestInit): Promise<putApiV10VideoIdResponse> => {
return useCustomClient<putVideoIdResponse>(getPutVideoIdUrl(id),
return useCustomClient<putApiV10VideoIdResponse>(getPutApiV10VideoIdUrl(id),
{
...options,
method: 'PUT',
......@@ -386,11 +386,11 @@ export const putVideoId = async (id: string,
export const getPutVideoIdMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putVideoId>>, TError,{id: string;data: BodyType<VideoMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof putVideoId>>, TError,{id: string;data: BodyType<VideoMutate>}, TContext> => {
export const getPutApiV10VideoIdMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putApiV10VideoId>>, TError,{id: string;data: BodyType<VideoMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof putApiV10VideoId>>, TError,{id: string;data: BodyType<VideoMutate>}, TContext> => {
const mutationKey = ['putVideoId'];
const mutationKey = ['putApiV10VideoId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -400,10 +400,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof putVideoId>>, {id: string;data: BodyType<VideoMutate>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof putApiV10VideoId>>, {id: string;data: BodyType<VideoMutate>}> = (props) => {
const {id,data} = props ?? {};
return putVideoId(id,data,requestOptions)
return putApiV10VideoId(id,data,requestOptions)
}
......@@ -411,23 +411,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PutVideoIdMutationResult = NonNullable<Awaited<ReturnType<typeof putVideoId>>>
export type PutVideoIdMutationBody = BodyType<VideoMutate>
export type PutVideoIdMutationError = ErrorType<unknown>
export type PutApiV10VideoIdMutationResult = NonNullable<Awaited<ReturnType<typeof putApiV10VideoId>>>
export type PutApiV10VideoIdMutationBody = BodyType<VideoMutate>
export type PutApiV10VideoIdMutationError = ErrorType<unknown>
/**
* @summary Replace a video
*/
export const usePutVideoId = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putVideoId>>, TError,{id: string;data: BodyType<VideoMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePutApiV10VideoId = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof putApiV10VideoId>>, TError,{id: string;data: BodyType<VideoMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof putVideoId>>,
Awaited<ReturnType<typeof putApiV10VideoId>>,
TError,
{id: string;data: BodyType<VideoMutate>},
TContext
> => {
const mutationOptions = getPutVideoIdMutationOptions(options);
const mutationOptions = getPutApiV10VideoIdMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
......@@ -435,29 +435,29 @@ export const usePutVideoId = <TError = ErrorType<unknown>,
* Delete a video record
* @summary Delete a video
*/
export type deleteVideoIdResponse200 = {
export type deleteApiV10VideoIdResponse200 = {
data: void
status: 200
}
export type deleteVideoIdResponseSuccess = (deleteVideoIdResponse200) & {
export type deleteApiV10VideoIdResponseSuccess = (deleteApiV10VideoIdResponse200) & {
headers: Headers;
};
;
export type deleteVideoIdResponse = (deleteVideoIdResponseSuccess)
export type deleteApiV10VideoIdResponse = (deleteApiV10VideoIdResponseSuccess)
export const getDeleteVideoIdUrl = (id: string,) => {
export const getDeleteApiV10VideoIdUrl = (id: string,) => {
return `/video/${id}`
return `/api/v1.0/video/${id}`
}
export const deleteVideoId = async (id: string, options?: RequestInit): Promise<deleteVideoIdResponse> => {
export const deleteApiV10VideoId = async (id: string, options?: RequestInit): Promise<deleteApiV10VideoIdResponse> => {
return useCustomClient<deleteVideoIdResponse>(getDeleteVideoIdUrl(id),
return useCustomClient<deleteApiV10VideoIdResponse>(getDeleteApiV10VideoIdUrl(id),
{
...options,
method: 'DELETE'
......@@ -469,11 +469,11 @@ export const deleteVideoId = async (id: string, options?: RequestInit): Promise<
export const getDeleteVideoIdMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteVideoId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof deleteVideoId>>, TError,{id: string}, TContext> => {
export const getDeleteApiV10VideoIdMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10VideoId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10VideoId>>, TError,{id: string}, TContext> => {
const mutationKey = ['deleteVideoId'];
const mutationKey = ['deleteApiV10VideoId'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -483,10 +483,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteVideoId>>, {id: string}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteApiV10VideoId>>, {id: string}> = (props) => {
const {id} = props ?? {};
return deleteVideoId(id,requestOptions)
return deleteApiV10VideoId(id,requestOptions)
}
......@@ -494,23 +494,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type DeleteVideoIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteVideoId>>>
export type DeleteApiV10VideoIdMutationResult = NonNullable<Awaited<ReturnType<typeof deleteApiV10VideoId>>>
export type DeleteVideoIdMutationError = ErrorType<unknown>
export type DeleteApiV10VideoIdMutationError = ErrorType<unknown>
/**
* @summary Delete a video
*/
export const useDeleteVideoId = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteVideoId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const useDeleteApiV10VideoId = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteApiV10VideoId>>, TError,{id: string}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof deleteVideoId>>,
Awaited<ReturnType<typeof deleteApiV10VideoId>>,
TError,
{id: string},
TContext
> => {
const mutationOptions = getDeleteVideoIdMutationOptions(options);
const mutationOptions = getDeleteApiV10VideoIdMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
......@@ -518,19 +518,19 @@ export const useDeleteVideoId = <TError = ErrorType<unknown>,
* Retrieve a list of videos with pagination, filtering and sorting
* @summary Get all videos
*/
export type getVideoResponse200 = {
export type getApiV10VideoResponse200 = {
data: ResponseGetAllData
status: 200
}
export type getVideoResponseSuccess = (getVideoResponse200) & {
export type getApiV10VideoResponseSuccess = (getApiV10VideoResponse200) & {
headers: Headers;
};
;
export type getVideoResponse = (getVideoResponseSuccess)
export type getApiV10VideoResponse = (getApiV10VideoResponseSuccess)
export const getGetVideoUrl = (params?: GetVideoParams,) => {
export const getGetApiV10VideoUrl = (params?: GetApiV10VideoParams,) => {
const normalizedParams = new URLSearchParams();
Object.entries(params || {}).forEach(([key, value]) => {
......@@ -542,12 +542,12 @@ export const getGetVideoUrl = (params?: GetVideoParams,) => {
const stringifiedParams = normalizedParams.toString();
return stringifiedParams.length > 0 ? `/video?${stringifiedParams}` : `/video`
return stringifiedParams.length > 0 ? `/api/v1.0/video?${stringifiedParams}` : `/api/v1.0/video`
}
export const getVideo = async (params?: GetVideoParams, options?: RequestInit): Promise<getVideoResponse> => {
export const getApiV10Video = async (params?: GetApiV10VideoParams, options?: RequestInit): Promise<getApiV10VideoResponse> => {
return useCustomClient<getVideoResponse>(getGetVideoUrl(params),
return useCustomClient<getApiV10VideoResponse>(getGetApiV10VideoUrl(params),
{
...options,
method: 'GET'
......@@ -560,75 +560,75 @@ export const getVideo = async (params?: GetVideoParams, options?: RequestInit):
export const getGetVideoInfiniteQueryKey = (params?: GetVideoParams,) => {
export const getGetApiV10VideoInfiniteQueryKey = (params?: GetApiV10VideoParams,) => {
return [
'infinite', `/video`, ...(params ? [params]: [])
'infinite', `/api/v1.0/video`, ...(params ? [params]: [])
] as const;
}
export const getGetVideoQueryKey = (params?: GetVideoParams,) => {
export const getGetApiV10VideoQueryKey = (params?: GetApiV10VideoParams,) => {
return [
`/video`, ...(params ? [params]: [])
`/api/v1.0/video`, ...(params ? [params]: [])
] as const;
}
export const getGetVideoInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getVideo>>>, TError = ErrorType<unknown>>(params?: GetVideoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getVideo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10VideoInfiniteQueryOptions = <TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Video>>>, TError = ErrorType<unknown>>(params?: GetApiV10VideoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Video>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetVideoInfiniteQueryKey(params);
const queryKey = queryOptions?.queryKey ?? getGetApiV10VideoInfiniteQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getVideo>>> = ({ signal }) => getVideo(params, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10Video>>> = ({ signal }) => getApiV10Video(params, { signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getVideo>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Video>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetVideoInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getVideo>>>
export type GetVideoInfiniteQueryError = ErrorType<unknown>
export type GetApiV10VideoInfiniteQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10Video>>>
export type GetApiV10VideoInfiniteQueryError = ErrorType<unknown>
export function useGetVideoInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getVideo>>>, TError = ErrorType<unknown>>(
params: undefined | GetVideoParams, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getVideo>>, TError, TData>> & Pick<
export function useGetApiV10VideoInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Video>>>, TError = ErrorType<unknown>>(
params: undefined | GetApiV10VideoParams, options: { query:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Video>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getVideo>>,
Awaited<ReturnType<typeof getApiV10Video>>,
TError,
Awaited<ReturnType<typeof getVideo>>
Awaited<ReturnType<typeof getApiV10Video>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetVideoInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getVideo>>>, TError = ErrorType<unknown>>(
params?: GetVideoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getVideo>>, TError, TData>> & Pick<
export function useGetApiV10VideoInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Video>>>, TError = ErrorType<unknown>>(
params?: GetApiV10VideoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Video>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getVideo>>,
Awaited<ReturnType<typeof getApiV10Video>>,
TError,
Awaited<ReturnType<typeof getVideo>>
Awaited<ReturnType<typeof getApiV10Video>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetVideoInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getVideo>>>, TError = ErrorType<unknown>>(
params?: GetVideoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getVideo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10VideoInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Video>>>, TError = ErrorType<unknown>>(
params?: GetApiV10VideoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Video>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get all videos
*/
export function useGetVideoInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getVideo>>>, TError = ErrorType<unknown>>(
params?: GetVideoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getVideo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10VideoInfinite<TData = InfiniteData<Awaited<ReturnType<typeof getApiV10Video>>>, TError = ErrorType<unknown>>(
params?: GetApiV10VideoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Video>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetVideoInfiniteQueryOptions(params,options)
const queryOptions = getGetApiV10VideoInfiniteQueryOptions(params,options)
const query = useInfiniteQuery(queryOptions, queryClient) as UseInfiniteQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -640,12 +640,12 @@ export function useGetVideoInfinite<TData = InfiniteData<Awaited<ReturnType<type
/**
* @summary Get all videos
*/
export const prefetchGetVideoInfiniteQuery = async <TData = Awaited<ReturnType<typeof getVideo>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetVideoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getVideo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10VideoInfiniteQuery = async <TData = Awaited<ReturnType<typeof getApiV10Video>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetApiV10VideoParams, options?: { query?:Partial<UseInfiniteQueryOptions<Awaited<ReturnType<typeof getApiV10Video>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetVideoInfiniteQueryOptions(params,options)
const queryOptions = getGetApiV10VideoInfiniteQueryOptions(params,options)
await queryClient.prefetchInfiniteQuery(queryOptions);
......@@ -654,62 +654,62 @@ export const prefetchGetVideoInfiniteQuery = async <TData = Awaited<ReturnType<t
export const getGetVideoQueryOptions = <TData = Awaited<ReturnType<typeof getVideo>>, TError = ErrorType<unknown>>(params?: GetVideoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getVideo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const getGetApiV10VideoQueryOptions = <TData = Awaited<ReturnType<typeof getApiV10Video>>, TError = ErrorType<unknown>>(params?: GetApiV10VideoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Video>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
) => {
const {query: queryOptions, request: requestOptions} = options ?? {};
const queryKey = queryOptions?.queryKey ?? getGetVideoQueryKey(params);
const queryKey = queryOptions?.queryKey ?? getGetApiV10VideoQueryKey(params);
const queryFn: QueryFunction<Awaited<ReturnType<typeof getVideo>>> = ({ signal }) => getVideo(params, { signal, ...requestOptions });
const queryFn: QueryFunction<Awaited<ReturnType<typeof getApiV10Video>>> = ({ signal }) => getApiV10Video(params, { signal, ...requestOptions });
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getVideo>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
return { queryKey, queryFn, retry: 3, retryDelay: 1000, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getApiV10Video>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
}
export type GetVideoQueryResult = NonNullable<Awaited<ReturnType<typeof getVideo>>>
export type GetVideoQueryError = ErrorType<unknown>
export type GetApiV10VideoQueryResult = NonNullable<Awaited<ReturnType<typeof getApiV10Video>>>
export type GetApiV10VideoQueryError = ErrorType<unknown>
export function useGetVideo<TData = Awaited<ReturnType<typeof getVideo>>, TError = ErrorType<unknown>>(
params: undefined | GetVideoParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getVideo>>, TError, TData>> & Pick<
export function useGetApiV10Video<TData = Awaited<ReturnType<typeof getApiV10Video>>, TError = ErrorType<unknown>>(
params: undefined | GetApiV10VideoParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Video>>, TError, TData>> & Pick<
DefinedInitialDataOptions<
Awaited<ReturnType<typeof getVideo>>,
Awaited<ReturnType<typeof getApiV10Video>>,
TError,
Awaited<ReturnType<typeof getVideo>>
Awaited<ReturnType<typeof getApiV10Video>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetVideo<TData = Awaited<ReturnType<typeof getVideo>>, TError = ErrorType<unknown>>(
params?: GetVideoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getVideo>>, TError, TData>> & Pick<
export function useGetApiV10Video<TData = Awaited<ReturnType<typeof getApiV10Video>>, TError = ErrorType<unknown>>(
params?: GetApiV10VideoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Video>>, TError, TData>> & Pick<
UndefinedInitialDataOptions<
Awaited<ReturnType<typeof getVideo>>,
Awaited<ReturnType<typeof getApiV10Video>>,
TError,
Awaited<ReturnType<typeof getVideo>>
Awaited<ReturnType<typeof getApiV10Video>>
> , 'initialData'
>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
export function useGetVideo<TData = Awaited<ReturnType<typeof getVideo>>, TError = ErrorType<unknown>>(
params?: GetVideoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getVideo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10Video<TData = Awaited<ReturnType<typeof getApiV10Video>>, TError = ErrorType<unknown>>(
params?: GetApiV10VideoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Video>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
/**
* @summary Get all videos
*/
export function useGetVideo<TData = Awaited<ReturnType<typeof getVideo>>, TError = ErrorType<unknown>>(
params?: GetVideoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getVideo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export function useGetApiV10Video<TData = Awaited<ReturnType<typeof getApiV10Video>>, TError = ErrorType<unknown>>(
params?: GetApiV10VideoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Video>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
const queryOptions = getGetVideoQueryOptions(params,options)
const queryOptions = getGetApiV10VideoQueryOptions(params,options)
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
......@@ -721,12 +721,12 @@ export function useGetVideo<TData = Awaited<ReturnType<typeof getVideo>>, TError
/**
* @summary Get all videos
*/
export const prefetchGetVideoQuery = async <TData = Awaited<ReturnType<typeof getVideo>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetVideoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getVideo>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
export const prefetchGetApiV10VideoQuery = async <TData = Awaited<ReturnType<typeof getApiV10Video>>, TError = ErrorType<unknown>>(
queryClient: QueryClient, params?: GetApiV10VideoParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getApiV10Video>>, TError, TData>>, request?: SecondParameter<typeof useCustomClient>}
): Promise<QueryClient> => {
const queryOptions = getGetVideoQueryOptions(params,options)
const queryOptions = getGetApiV10VideoQueryOptions(params,options)
await queryClient.prefetchQuery(queryOptions);
......@@ -739,29 +739,29 @@ export const prefetchGetVideoQuery = async <TData = Awaited<ReturnType<typeof ge
* Create a new video record
* @summary Create a video
*/
export type postVideoResponse200 = {
data: PostVideo200
export type postApiV10VideoResponse200 = {
data: PostApiV10Video200
status: 200
}
export type postVideoResponseSuccess = (postVideoResponse200) & {
export type postApiV10VideoResponseSuccess = (postApiV10VideoResponse200) & {
headers: Headers;
};
;
export type postVideoResponse = (postVideoResponseSuccess)
export type postApiV10VideoResponse = (postApiV10VideoResponseSuccess)
export const getPostVideoUrl = () => {
export const getPostApiV10VideoUrl = () => {
return `/video`
return `/api/v1.0/video`
}
export const postVideo = async (videoMutate: VideoMutate, options?: RequestInit): Promise<postVideoResponse> => {
export const postApiV10Video = async (videoMutate: VideoMutate, options?: RequestInit): Promise<postApiV10VideoResponse> => {
return useCustomClient<postVideoResponse>(getPostVideoUrl(),
return useCustomClient<postApiV10VideoResponse>(getPostApiV10VideoUrl(),
{
...options,
method: 'POST',
......@@ -774,11 +774,11 @@ export const postVideo = async (videoMutate: VideoMutate, options?: RequestInit)
export const getPostVideoMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postVideo>>, TError,{data: BodyType<VideoMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postVideo>>, TError,{data: BodyType<VideoMutate>}, TContext> => {
export const getPostApiV10VideoMutationOptions = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postApiV10Video>>, TError,{data: BodyType<VideoMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
): UseMutationOptions<Awaited<ReturnType<typeof postApiV10Video>>, TError,{data: BodyType<VideoMutate>}, TContext> => {
const mutationKey = ['postVideo'];
const mutationKey = ['postApiV10Video'];
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
......@@ -788,10 +788,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
const mutationFn: MutationFunction<Awaited<ReturnType<typeof postVideo>>, {data: BodyType<VideoMutate>}> = (props) => {
const mutationFn: MutationFunction<Awaited<ReturnType<typeof postApiV10Video>>, {data: BodyType<VideoMutate>}> = (props) => {
const {data} = props ?? {};
return postVideo(data,requestOptions)
return postApiV10Video(data,requestOptions)
}
......@@ -799,23 +799,23 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
return { mutationFn, ...mutationOptions }}
export type PostVideoMutationResult = NonNullable<Awaited<ReturnType<typeof postVideo>>>
export type PostVideoMutationBody = BodyType<VideoMutate>
export type PostVideoMutationError = ErrorType<unknown>
export type PostApiV10VideoMutationResult = NonNullable<Awaited<ReturnType<typeof postApiV10Video>>>
export type PostApiV10VideoMutationBody = BodyType<VideoMutate>
export type PostApiV10VideoMutationError = ErrorType<unknown>
/**
* @summary Create a video
*/
export const usePostVideo = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postVideo>>, TError,{data: BodyType<VideoMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
export const usePostApiV10Video = <TError = ErrorType<unknown>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof postApiV10Video>>, TError,{data: BodyType<VideoMutate>}, TContext>, request?: SecondParameter<typeof useCustomClient>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof postVideo>>,
Awaited<ReturnType<typeof postApiV10Video>>,
TError,
{data: BodyType<VideoMutate>},
TContext
> => {
const mutationOptions = getPostVideoMutationOptions(options);
const mutationOptions = getPostApiV10VideoMutationOptions(options);
return useMutation(mutationOptions, queryClient);
}
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { BadRequestResponseError } from './badRequestResponseError';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { BadRequestResponseErrorMessage } from './badRequestResponseErrorMessage';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
......@@ -5,16 +5,21 @@
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { BannerStatus } from './bannerStatus';
export interface Banner {
id?: string;
banner_name?: string;
display_order?: number;
status?: string;
file_id?: string;
created_at?: string;
created_by?: string;
updated_at?: string;
updated_by?: string;
id: string;
/** @maxLength 255 */
banner_name: string;
display_order: number;
/** @minimum 1 */
display_time?: number;
status: BannerStatus;
file_id: string;
created_at: string;
/** @nullable */
created_by?: string | null;
updated_at: string;
/** @nullable */
updated_by?: string | null;
}
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { BannerCreateStatus } from './bannerCreateStatus';
export interface BannerCreate {
/** @maxLength 255 */
banner_name: string;
display_order?: number;
/** @minimum 1 */
display_time?: number;
status?: BannerCreateStatus;
file_id: string;
}
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
export type BannerCreateStatus = typeof BannerCreateStatus[keyof typeof BannerCreateStatus];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const BannerCreateStatus = {
ACTIVE: 'ACTIVE',
INACTIVE: 'INACTIVE',
} as const;
......@@ -5,11 +5,6 @@
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { BannerCreate } from './bannerCreate';
export interface BannerMutate {
banner_name?: string;
display_order?: number;
status?: string;
file_id?: string;
display_time?: number;
}
export type BannerMutate = BannerCreate;
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
export type BannerStatus = typeof BannerStatus[keyof typeof BannerStatus];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const BannerStatus = {
ACTIVE: 'ACTIVE',
INACTIVE: 'INACTIVE',
} as const;
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { BannerUpdateStatus } from './bannerUpdateStatus';
export interface BannerUpdate {
/** @maxLength 255 */
banner_name?: string;
display_order?: number;
/** @minimum 1 */
display_time?: number;
status?: BannerUpdateStatus;
file_id?: string;
}
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
export type BannerUpdateStatus = typeof BannerUpdateStatus[keyof typeof BannerUpdateStatus];
// eslint-disable-next-line @typescript-eslint/no-redeclare
export const BannerUpdateStatus = {
ACTIVE: 'ACTIVE',
INACTIVE: 'INACTIVE',
} as const;
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { ApiResponse } from './apiResponse';
import type { DeleteApiV10BannerId200AllOf } from './deleteApiV10BannerId200AllOf';
export type DeleteApiV10BannerId200 = ApiResponse & DeleteApiV10BannerId200AllOf;
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
export type DeleteApiV10BannerId200AllOf = {
responseData?: boolean;
};
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { ApiResponse } from './apiResponse';
import type { DeleteApiV10LogoId200AllOf } from './deleteApiV10LogoId200AllOf';
export type DeleteApiV10LogoId200 = ApiResponse & DeleteApiV10LogoId200AllOf;
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
export type DeleteApiV10LogoId200AllOf = {
responseData?: boolean;
};
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { ApiResponse } from './apiResponse';
import type { GetApiV10BannerId200AllOf } from './getApiV10BannerId200AllOf';
export type GetApiV10BannerId200 = ApiResponse & GetApiV10BannerId200AllOf;
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { Banner } from './banner';
export type GetApiV10BannerId200AllOf = {
responseData?: Banner;
};
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { FiltersParameter } from './filtersParameter';
import type { SortFieldParameter } from './sortFieldParameter';
import type { SortOrderParameter } from './sortOrderParameter';
import type { PageParameter } from './pageParameter';
import type { PageSizeParameter } from './pageSizeParameter';
export type GetApiV10BannerParams = {
/**
* filter, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
filters?: FiltersParameter;
/**
* sortField, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
sortField?: SortFieldParameter;
/**
* sort order, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
sortOrder?: SortOrderParameter;
/**
* page, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
* @minimum 1
*/
page?: PageParameter;
/**
* pageSize, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
* @minimum 1
*/
pageSize?: PageSizeParameter;
};
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { ApiResponse } from './apiResponse';
import type { GetApiV10LogoId200AllOf } from './getApiV10LogoId200AllOf';
export type GetApiV10LogoId200 = ApiResponse & GetApiV10LogoId200AllOf;
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { Logo } from './logo';
export type GetApiV10LogoId200AllOf = {
responseData?: Logo;
};
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { FiltersParameter } from './filtersParameter';
import type { SortFieldParameter } from './sortFieldParameter';
import type { SortOrderParameter } from './sortOrderParameter';
import type { PageParameter } from './pageParameter';
import type { PageSizeParameter } from './pageSizeParameter';
export type GetApiV10LogoParams = {
/**
* filter, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
filters?: FiltersParameter;
/**
* sortField, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
sortField?: SortFieldParameter;
/**
* sort order, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
*/
sortOrder?: SortOrderParameter;
/**
* page, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
* @minimum 1
*/
page?: PageParameter;
/**
* pageSize, visit https://www.npmjs.com/package/sequelize-api-paginate for syntax
* @minimum 1
*/
pageSize?: PageSizeParameter;
};
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......@@ -17,7 +17,12 @@ export * from './badRequestResponseErrorMessage';
export * from './badRequestResponseResponseData';
export * from './badRequestResponseViolationItem';
export * from './banner';
export * from './bannerCreate';
export * from './bannerCreateStatus';
export * from './bannerMutate';
export * from './bannerStatus';
export * from './bannerUpdate';
export * from './bannerUpdateStatus';
export * from './business';
export * from './businessCreate';
export * from './businessDeleteResponse';
......@@ -40,10 +45,14 @@ export * from './categoryTagMutate';
export * from './categoryThumbnail';
export * from './contact';
export * from './contactMutate';
export * from './deleteApiV10BannerId200';
export * from './deleteApiV10BannerId200AllOf';
export * from './deleteApiV10CategoryId200';
export * from './deleteApiV10CategoryId200AllOf';
export * from './deleteApiV10ContactId200';
export * from './deleteApiV10ContactId200AllOf';
export * from './deleteApiV10LogoId200';
export * from './deleteApiV10LogoId200AllOf';
export * from './deleteApprovalParams';
export * from './deleteBannerId200';
export * from './deleteBannerId200AllOf';
......@@ -93,12 +102,18 @@ export * from './forgotPasswordResetRequest';
export * from './forgotPasswordSendOtpRequest';
export * from './forgotPasswordVerifyOtpRequest';
export * from './forgotPasswordVerifyOtpResponse';
export * from './getApiV10BannerId200';
export * from './getApiV10BannerId200AllOf';
export * from './getApiV10BannerParams';
export * from './getApiV10CategoryId200';
export * from './getApiV10CategoryId200AllOf';
export * from './getApiV10CategoryParams';
export * from './getApiV10ContactId200';
export * from './getApiV10ContactId200AllOf';
export * from './getApiV10ContactParams';
export * from './getApiV10LogoId200';
export * from './getApiV10LogoId200AllOf';
export * from './getApiV10LogoParams';
export * from './getApiV10NewsletterSubscriptionParams';
export * from './getApiV10PageConfigParams';
export * from './getApiV10SiteInformation200';
......@@ -261,10 +276,14 @@ export * from './permissionUpdate';
export * from './position';
export * from './positionMutate';
export * from './post';
export * from './postApiV10Banner200';
export * from './postApiV10Banner200AllOf';
export * from './postApiV10Category200';
export * from './postApiV10Category200AllOf';
export * from './postApiV10Contact200';
export * from './postApiV10Contact200AllOf';
export * from './postApiV10Logo200';
export * from './postApiV10Logo200AllOf';
export * from './postApiV10NewsletterSubscription200';
export * from './postApiV10NewsletterSubscription200AllOf';
export * from './postApiV10PageConfigBody';
......@@ -312,10 +331,14 @@ export * from './postUsersFavoriteAddParams';
export * from './postValidatorOrgCodeBody';
export * from './postVideo200';
export * from './postVideo200AllOf';
export * from './putApiV10BannerId200';
export * from './putApiV10BannerId200AllOf';
export * from './putApiV10CategoryId200';
export * from './putApiV10CategoryId200AllOf';
export * from './putApiV10ContactId200';
export * from './putApiV10ContactId200AllOf';
export * from './putApiV10LogoId200';
export * from './putApiV10LogoId200AllOf';
export * from './putApiV10PageConfigIdBody';
export * from './putApiV10SiteInformation200';
export * from './putApiV10SiteInformation200AllOf';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { LoginRequestDeviceInfo } from './loginRequestDeviceInfo';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { MemberImportWarningItem } from './memberImportWarningItem';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { PermissionCreate } from './permissionCreate';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { PermissionCreate } from './permissionCreate';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { ApiResponse } from './apiResponse';
import type { PostApiV10Banner200AllOf } from './postApiV10Banner200AllOf';
export type PostApiV10Banner200 = ApiResponse & PostApiV10Banner200AllOf;
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { Banner } from './banner';
export type PostApiV10Banner200AllOf = {
responseData?: Banner;
};
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { ApiResponse } from './apiResponse';
import type { PostApiV10Logo200AllOf } from './postApiV10Logo200AllOf';
export type PostApiV10Logo200 = ApiResponse & PostApiV10Logo200AllOf;
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { Logo } from './logo';
export type PostApiV10Logo200AllOf = {
responseData?: Logo;
};
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { ApiResponse } from './apiResponse';
import type { PutApiV10BannerId200AllOf } from './putApiV10BannerId200AllOf';
export type PutApiV10BannerId200 = ApiResponse & PutApiV10BannerId200AllOf;
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { Banner } from './banner';
export type PutApiV10BannerId200AllOf = {
responseData?: Banner;
};
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { ApiResponse } from './apiResponse';
import type { PutApiV10LogoId200AllOf } from './putApiV10LogoId200AllOf';
export type PutApiV10LogoId200 = ApiResponse & PutApiV10LogoId200AllOf;
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { Logo } from './logo';
export type PutApiV10LogoId200AllOf = {
responseData?: Logo;
};
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { ResponseResponseData } from './responseResponseData';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { Response } from './response';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { ResponseGetAllDataAllOfResponseData } from './responseGetAllDataAllOfResponseData';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { ResponseGetAllDataAllOfResponseDataRowsItem } from './responseGetAllDataAllOfResponseDataRowsItem';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { RoleCreate } from './roleCreate';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { SiteInformationDataLogo } from './siteInformationDataLogo';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { Logo } from './logo';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { ApiResponse } from './apiResponse';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { SiteInformationData } from './siteInformationData';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { SiteInformationSocialLink } from './siteInformationSocialLink';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { TermPositionRequestItem } from './termPositionRequestItem';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { TermMemberAvatarProperty } from './termMemberAvatarProperty';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { TermMemberAvatar } from './termMemberAvatar';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { TermMember } from './termMember';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { TermPositionResponse } from './termPositionResponse';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { TermPositionRequestItem } from './termPositionRequestItem';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { UnauthorizedResponseError } from './unauthorizedResponseError';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
import type { UnauthorizedResponseErrorMessage } from './unauthorizedResponseErrorMessage';
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
/**
* Generated by orval v8.0.0-rc.0 🍺
* Do not edit manually.
* Backend Template
* Coded by Meu TEAM
* VietProDev CMS Backend API
* Generated API documentation
* OpenAPI spec version: 1.0.0
*/
......
......@@ -7,7 +7,7 @@ import { Swiper as SwiperType } from "swiper/types";
import { useRef } from "react";
import "swiper/css";
import { getBanner } from "@/api/endpoints/banner";
import { getApiV10Banner } from "@/api/endpoints/banner";
import { useQuery } from "@tanstack/react-query";
import { resolveCmsFileUrl } from "@/lib/api/files";
import { Skeleton } from "@/components/ui/skeleton";
......@@ -100,7 +100,7 @@ const Banner = () => {
const { data: bannerData, isPending, isError } = useQuery({
queryKey: ["home-banner"],
queryFn: () =>
getBanner({
getApiV10Banner({
filters: "status@=ACTIVE",
sortField: "display_order",
sortOrder: "asc",
......
......@@ -15,7 +15,7 @@ import {
import Link from "next/link";
import { useQuery } from "@tanstack/react-query";
import { subscribeNewsletterEmail } from "@/lib/api/newsletter-subscriptions";
import { getSiteInformation } from "@/api/endpoints/site-information";
import { getApiV10SiteInformation } from "@/api/endpoints/site-information";
import type { SiteInformationData } from "@/api/models";
import { ZaloIcon, TiktokIcon } from "@/components/ui/icons";
......@@ -92,7 +92,7 @@ function Footer() {
const { data: siteInformationResponse } =
useQuery<ApiEnvelope<SiteInformationData> | null>({
queryKey: ["site-information"],
queryFn: () => getSiteInformation().catch(() => null),
queryFn: () => getApiV10SiteInformation().catch(() => null),
staleTime: 5 * 60 * 1000,
});
......
......@@ -7,8 +7,8 @@ import { useQuery } from "@tanstack/react-query";
import Image from "next/image";
import Link from "next/link";
import logo from "@/assets/VCCI-HCM-logo-VN-2025.png";
import { useGetLogo } from "@/api/endpoints/logo";
import { getSiteInformation } from "@/api/endpoints/site-information";
import { useGetApiV10Logo } from "@/api/endpoints/logo";
import { getApiV10SiteInformation } from "@/api/endpoints/site-information";
import { resolveUploadUrl } from "@/links";
import type { Logo } from "@/api/models/logo";
import type {
......@@ -185,7 +185,7 @@ function Header() {
staleTime: 5 * 60 * 1000,
});
const { data: currentLogo = null } = useGetLogo(
const { data: currentLogo = null } = useGetApiV10Logo(
{
page: 1,
pageSize: 1,
......@@ -206,7 +206,7 @@ function Header() {
const { data: siteInformationResponse } =
useQuery<ApiEnvelope<SiteInformationData> | null>({
queryKey: ["site-information"],
queryFn: () => getSiteInformation().catch(() => null),
queryFn: () => getApiV10SiteInformation().catch(() => null),
staleTime: 5 * 60 * 1000,
});
......
......@@ -43,24 +43,24 @@ import { Switch } from "@/components/ui/switch";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Textarea } from "@/components/ui/textarea";
import {
deleteSiteInformationBranchesId,
getSiteInformation,
patchSiteInformationBranchesId,
patchSiteInformationSocialsId,
postSiteInformationBranches,
putSiteInformation,
deleteApiV10SiteInformationBranchesId,
getApiV10SiteInformation,
patchApiV10SiteInformationBranchesId,
patchApiV10SiteInformationSocialsId,
postApiV10SiteInformationBranches,
putApiV10SiteInformation,
} from "@/api/endpoints/site-information";
import {
deleteLogoId,
getLogo,
postLogo,
putLogoId,
deleteApiV10LogoId,
getApiV10Logo,
postApiV10Logo,
putApiV10LogoId,
} from "@/api/endpoints/logo";
import {
deleteBannerId,
getBanner,
postBanner,
putBannerId,
deleteApiV10BannerId,
getApiV10Banner,
postApiV10Banner,
putApiV10BannerId,
} from "@/api/endpoints/banner";
import type {
Banner,
......@@ -567,8 +567,8 @@ export default function AdminBaseConfigPage() {
const loadSiteInformation = async () => {
try {
const [siteInformationResponse, logoResponse] = await Promise.all([
getSiteInformation(),
getLogo({
getApiV10SiteInformation(),
getApiV10Logo({
page: 1,
pageSize: 1,
sortField: "updated_at",
......@@ -635,7 +635,7 @@ export default function AdminBaseConfigPage() {
const loadBanners = async () => {
try {
const response = await getBanner({
const response = await getApiV10Banner({
page: 1,
pageSize: 100,
sortField: "display_order",
......@@ -776,12 +776,12 @@ export default function AdminBaseConfigPage() {
try {
const response = currentLogoId
? await putLogoId(currentLogoId, {
? await putApiV10LogoId(currentLogoId, {
logo_name: trimmedName,
logo_url: selectedMedia?.url ?? null,
file_id: itemForm.imageId,
})
: await postLogo({
: await postApiV10Logo({
logo_name: trimmedName,
logo_url: selectedMedia?.url ?? null,
file_id: itemForm.imageId,
......@@ -821,8 +821,8 @@ export default function AdminBaseConfigPage() {
try {
const response = editingItemId
? await putBannerId(editingItemId, mapConfigBannerToApi(bannerDraft))
: await postBanner(mapConfigBannerToApi(bannerDraft));
? await putApiV10BannerId(editingItemId, mapConfigBannerToApi(bannerDraft))
: await postApiV10Banner(mapConfigBannerToApi(bannerDraft));
const savedBanner = getEnvelopeData<Banner>(response);
const nextBanner = savedBanner
? mapApiBannerToConfig(savedBanner)
......@@ -890,7 +890,7 @@ export default function AdminBaseConfigPage() {
if (deleteTarget.mode === "logo") {
try {
await deleteLogoId(deleteTarget.id);
await deleteApiV10LogoId(deleteTarget.id);
nextConfig.logo = null;
queryClient.invalidateQueries({ queryKey: ["/logo"] });
} catch (error) {
......@@ -900,7 +900,7 @@ export default function AdminBaseConfigPage() {
return;
}
} else {
await deleteBannerId(deleteTarget.id);
await deleteApiV10BannerId(deleteTarget.id);
nextConfig.banners = nextConfig.banners.filter(
(item) => item.id !== deleteTarget.id,
);
......@@ -987,7 +987,7 @@ export default function AdminBaseConfigPage() {
setSavingContact(true);
try {
const response = await postSiteInformationBranches({
const response = await postApiV10SiteInformationBranches({
branch_name: `Chi nhánh ${config.branches.length + 1}`,
sort_order: config.branches.length + 1,
is_active: true,
......@@ -1027,7 +1027,7 @@ export default function AdminBaseConfigPage() {
setSavingContact(true);
try {
await deleteSiteInformationBranchesId(branchId);
await deleteApiV10SiteInformationBranchesId(branchId);
const nextConfig = cloneBaseConfigData(config);
nextConfig.branches = nextConfig.branches.filter(
......@@ -1057,7 +1057,7 @@ export default function AdminBaseConfigPage() {
try {
await Promise.all(
sortBaseConfigBranches(config.branches).map((branch, index) =>
patchSiteInformationBranchesId(
patchApiV10SiteInformationBranchesId(
branch.id,
mapConfigBranchToApi(branch, index),
),
......@@ -1087,7 +1087,7 @@ export default function AdminBaseConfigPage() {
setSavingWebsiteInfo(true);
try {
const response = await putSiteInformation({
const response = await putApiV10SiteInformation({
website_name: config.websiteName.trim() || null,
website_link: config.websiteLink.trim() || null,
});
......@@ -1140,7 +1140,7 @@ export default function AdminBaseConfigPage() {
try {
await Promise.all(
config.socials.map((social) =>
patchSiteInformationSocialsId(
patchApiV10SiteInformationSocialsId(
social.id,
mapConfigSocialToApi(social),
),
......
......@@ -15,7 +15,7 @@ import {
} from "lucide-react";
import { toast } from "sonner";
import { useQuery } from "@tanstack/react-query";
import { useGetLogo } from "@/api/endpoints/logo";
import { useGetApiV10Logo } from "@/api/endpoints/logo";
import type { Logo } from "@/api/models/logo";
import { Button } from "@/components/ui/button";
import { Checkbox } from "@/components/ui/checkbox";
......@@ -131,7 +131,7 @@ function AuthShell({
mode: AuthMode;
children: React.ReactNode;
}) {
const { data: logoData } = useGetLogo(
const { data: logoData } = useGetApiV10Logo(
{
page: 1,
pageSize: 1,
......
......@@ -26,10 +26,10 @@ import {
TableRow,
} from "@/components/ui/table";
import {
deleteVideoId,
getVideo,
patchVideoId,
postVideo,
deleteApiV10VideoId,
getApiV10Video,
patchApiV10VideoId,
postApiV10Video,
} from "@/api/endpoints/video";
import type { Video as CmsVideoItem } from "@/api/models/video";
import { readVideoPageData, readVideoRows } from "@/lib/api/videos";
......@@ -183,7 +183,7 @@ export default function AdminVideosPage() {
try {
const keyword = search.trim();
const response = await getVideo({
const response = await getApiV10Video({
page,
pageSize: PAGE_SIZE,
sortField: "created_at",
......@@ -228,10 +228,10 @@ export default function AdminVideosPage() {
try {
if (data.id) {
await patchVideoId(data.id, { name: data.name, url: data.url });
await patchApiV10VideoId(data.id, { name: data.name, url: data.url });
toast.success("Đã cập nhật video");
} else {
await postVideo({ name: data.name, url: data.url });
await postApiV10Video({ name: data.name, url: data.url });
toast.success("Đã thêm video mới");
}
......@@ -248,7 +248,7 @@ export default function AdminVideosPage() {
if (!deleteTarget) return;
try {
await deleteVideoId(deleteTarget.id);
await deleteApiV10VideoId(deleteTarget.id);
toast.success("Đã xóa video");
setDeleteTarget(null);
await loadVideos();
......
......@@ -17,7 +17,7 @@ import {
Video,
} from "lucide-react";
import { useQuery } from "@tanstack/react-query";
import { useGetLogo } from "@/api/endpoints/logo";
import { useGetApiV10Logo } from "@/api/endpoints/logo";
import type { Logo } from "@/api/models/logo";
import logo from "@/assets/VCCI-HCM-logo-VN-2025.png";
import { resolveUploadUrl } from "@/links";
......@@ -90,7 +90,7 @@ export function AdminSidebar() {
Record<string, boolean>
>({});
const { data: logoData } = useGetLogo(
const { data: logoData } = useGetApiV10Logo(
{
page: 1,
pageSize: 1,
......
"use client";
import {
deleteNewsletterSubscriptionId,
getNewsletterSubscription,
patchNewsletterSubscriptionId,
postNewsletterSubscription,
deleteApiV10NewsletterSubscriptionId,
getApiV10NewsletterSubscription,
patchApiV10NewsletterSubscriptionId,
postApiV10NewsletterSubscription,
} from "@/api/endpoints/newsletter-subscription";
import type { NewsletterSubscription } from "@/api/models/newsletterSubscription";
......@@ -31,7 +31,7 @@ export async function fetchNewsletterSubscriptions(params?: {
sortOrder?: "asc" | "desc";
filters?: string;
}) {
const response = await getNewsletterSubscription({
const response = await getApiV10NewsletterSubscription({
page: params?.page ?? 1,
pageSize: params?.pageSize ?? 10,
sortField: params?.sortField ?? "created_at",
......@@ -49,13 +49,13 @@ export async function fetchNewsletterSubscriptions(params?: {
}
export async function subscribeNewsletterEmail(email: string) {
return postNewsletterSubscription({ email: email.trim() });
return postApiV10NewsletterSubscription({ email: email.trim() });
}
export async function deleteNewsletterSubscription(id: string) {
return deleteNewsletterSubscriptionId(id);
return deleteApiV10NewsletterSubscriptionId(id);
}
export async function markNewsletterSubscriptionSeen(id: string) {
return patchNewsletterSubscriptionId(id, { is_seen: true });
return patchApiV10NewsletterSubscriptionId(id, { is_seen: true });
}
"use client";
import { getVideo } from "@/api/endpoints/video";
import { getApiV10Video } from "@/api/endpoints/video";
import type { Video } from "@/api/models/video";
export type ClientVideoItem = Video & {
......@@ -81,7 +81,7 @@ export const normalizeVideoUrl = (url: string) => {
export async function fetchClientVideos(params?: { page?: number; pageSize?: number }) {
try {
const response = await getVideo({
const response = await getApiV10Video({
page: params?.page ?? 1,
pageSize: params?.pageSize ?? 10,
sortField: "created_at",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment