fix edit product

- set default value to optional
This commit is contained in:
Wikzyy
2025-04-09 11:11:19 +07:00
parent 3b5627a6cb
commit 44e88ac4e0

View File

@ -114,17 +114,17 @@ const EditDialog = () => {
if (response?.status) {
setFormField((prev) => ({
...prev,
name: response.data.name,
type: response.data.type,
code: response.data.code,
description: response.data.description,
price_point: response.data.price_point,
price_cash: response.data.price_cash,
cashback_point: response.data.cashback_point,
cashback_cash: response.data.cashback_cash,
status: response.data.status,
provider: response.data.provider.id,
process_on_third_party: response.data.process_on_third_party
name: response.data?.name,
type: response.data?.type,
code: response.data?.code,
description: response.data?.description,
price_point: response.data?.price_point,
price_cash: response.data?.price_cash,
cashback_point: response.data?.cashback_point,
cashback_cash: response.data?.cashback_cash,
status: response.data?.status,
provider: response.data?.provider?.id,
process_on_third_party: response.data?.process_on_third_party
}));
} else {
setFormField(initialState);