fix(products): add product_cover_image_id to schema and type definitions
This commit is contained in:
parent
3d437aeb53
commit
de5ab3c476
|
|
@ -28,3 +28,4 @@ export const useUpdatePaymentCard = () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,3 +17,4 @@ export interface UpdatePaymentCardResponse {
|
||||||
success?: boolean;
|
success?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,3 +19,4 @@ export const updatePaymentCard = async (
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,3 +32,4 @@ export const useUpdateIPGStatus = () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,3 +27,4 @@ export const IPG_LABELS: Record<IPGType, string> = {
|
||||||
zarinpal: "زرینپال",
|
zarinpal: "زرینپال",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,3 +19,4 @@ export const updateIPGStatus = async (
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -147,3 +147,4 @@ const IPGListPage = () => {
|
||||||
|
|
||||||
export default IPGListPage;
|
export default IPGListPage;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
|
|
@ -28,3 +28,4 @@ export const useUpdateWalletStatus = () => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,3 +24,4 @@ export const WALLET_LABELS: Record<WalletType, string> = {
|
||||||
rial: "کیف پول (ریال)",
|
rial: "کیف پول (ریال)",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,3 +19,4 @@ export const updateWalletStatus = async (
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -147,3 +147,4 @@ const WalletListPage = () => {
|
||||||
|
|
||||||
export default WalletListPage;
|
export default WalletListPage;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue