feat: deal barcodes printing, refactored ff module
This commit is contained in:
@ -61,6 +61,7 @@ import {
|
||||
getBaseMarketplaces,
|
||||
getBoards,
|
||||
getClients,
|
||||
getDealBarcodesPdf,
|
||||
getDealModuleAttributes,
|
||||
getDealProducts,
|
||||
getDeals,
|
||||
@ -240,6 +241,9 @@ import type {
|
||||
GetBaseMarketplacesData,
|
||||
GetBoardsData,
|
||||
GetClientsData,
|
||||
GetDealBarcodesPdfData,
|
||||
GetDealBarcodesPdfError,
|
||||
GetDealBarcodesPdfResponse2,
|
||||
GetDealModuleAttributesData,
|
||||
GetDealProductsData,
|
||||
GetDealsData,
|
||||
@ -2902,6 +2906,57 @@ export const getProductBarcodePdfMutation = (
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const getDealBarcodesPdfQueryKey = (
|
||||
options: Options<GetDealBarcodesPdfData>
|
||||
) => createQueryKey("getDealBarcodesPdf", options);
|
||||
|
||||
/**
|
||||
* Get Deal Barcodes Pdf
|
||||
*/
|
||||
export const getDealBarcodesPdfOptions = (
|
||||
options: Options<GetDealBarcodesPdfData>
|
||||
) => {
|
||||
return queryOptions({
|
||||
queryFn: async ({ queryKey, signal }) => {
|
||||
const { data } = await getDealBarcodesPdf({
|
||||
...options,
|
||||
...queryKey[0],
|
||||
signal,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
queryKey: getDealBarcodesPdfQueryKey(options),
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Get Deal Barcodes Pdf
|
||||
*/
|
||||
export const getDealBarcodesPdfMutation = (
|
||||
options?: Partial<Options<GetDealBarcodesPdfData>>
|
||||
): UseMutationOptions<
|
||||
GetDealBarcodesPdfResponse2,
|
||||
AxiosError<GetDealBarcodesPdfError>,
|
||||
Options<GetDealBarcodesPdfData>
|
||||
> => {
|
||||
const mutationOptions: UseMutationOptions<
|
||||
GetDealBarcodesPdfResponse2,
|
||||
AxiosError<GetDealBarcodesPdfError>,
|
||||
Options<GetDealBarcodesPdfData>
|
||||
> = {
|
||||
mutationFn: async localOptions => {
|
||||
const { data } = await getDealBarcodesPdf({
|
||||
...options,
|
||||
...localOptions,
|
||||
throwOnError: true,
|
||||
});
|
||||
return data;
|
||||
},
|
||||
};
|
||||
return mutationOptions;
|
||||
};
|
||||
|
||||
export const uploadProductBarcodeImageQueryKey = (
|
||||
options: Options<UploadProductBarcodeImageData>
|
||||
) => createQueryKey("uploadProductBarcodeImage", options);
|
||||
|
||||
Reference in New Issue
Block a user