fix(products): add product_cover_image_id to schema and type definitions

This commit is contained in:
hosseintaromi 2025-12-25 21:06:26 +03:30
parent 3d437aeb53
commit de5ab3c476
13 changed files with 14 additions and 1 deletions

View File

@ -28,3 +28,4 @@ export const useUpdatePaymentCard = () => {
}); });
}; };

View File

@ -17,3 +17,4 @@ export interface UpdatePaymentCardResponse {
success?: boolean; success?: boolean;
} }

View File

@ -19,3 +19,4 @@ export const updatePaymentCard = async (
return response.data; return response.data;
}; };

View File

@ -32,3 +32,4 @@ export const useUpdateIPGStatus = () => {
}); });
}; };

View File

@ -27,3 +27,4 @@ export const IPG_LABELS: Record<IPGType, string> = {
zarinpal: "زرین‌پال", zarinpal: "زرین‌پال",
}; };

View File

@ -19,3 +19,4 @@ export const updateIPGStatus = async (
return response.data; return response.data;
}; };

View File

@ -147,3 +147,4 @@ const IPGListPage = () => {
export default IPGListPage; export default IPGListPage;

View File

@ -69,6 +69,7 @@ export interface ProductFormData {
variants: ProductVariantFormData[]; variants: ProductVariantFormData[];
explorer_file_ids?: ProductImage[]; explorer_file_ids?: ProductImage[];
is_delete_latest_explorer_files?: boolean; is_delete_latest_explorer_files?: boolean;
product_cover_image_id?: string;
} }
export interface ProductVariantFormData { export interface ProductVariantFormData {

View File

@ -37,6 +37,7 @@ const productSchema = yup.object({
variants: yup.array().default([]), variants: yup.array().default([]),
explorer_file_ids: yup.array().of(yup.object()).default([]), explorer_file_ids: yup.array().of(yup.object()).default([]),
is_delete_latest_explorer_files: yup.boolean().optional(), is_delete_latest_explorer_files: yup.boolean().optional(),
product_cover_image_id: yup.string().optional(),
}); });
const toPublicUrl = (img: any): ProductImage => { const toPublicUrl = (img: any): ProductImage => {
@ -152,7 +153,7 @@ const ProductFormPage = () => {
}); });
const formValues = watch(); const formValues = watch();
const coverId = watch('product_cover_image_id'); const coverId = watch('product_cover_image_id') as string | undefined;
useEffect(() => { useEffect(() => {
if (isEdit && product) { if (isEdit && product) {

View File

@ -28,3 +28,4 @@ export const useUpdateWalletStatus = () => {
}); });
}; };

View File

@ -24,3 +24,4 @@ export const WALLET_LABELS: Record<WalletType, string> = {
rial: "کیف پول (ریال)", rial: "کیف پول (ریال)",
}; };

View File

@ -19,3 +19,4 @@ export const updateWalletStatus = async (
return response.data; return response.data;
}; };

View File

@ -147,3 +147,4 @@ const WalletListPage = () => {
export default WalletListPage; export default WalletListPage;