add default cheque quantity
All checks were successful
Deploy Amap / deploy (push) Successful in 29s
All checks were successful
Deploy Amap / deploy (push) Successful in 29s
This commit is contained in:
@@ -35,7 +35,7 @@ export function Contract() {
|
|||||||
email: "",
|
email: "",
|
||||||
phone: "",
|
phone: "",
|
||||||
payment_method: "",
|
payment_method: "",
|
||||||
cheque_quantity: 0,
|
cheque_quantity: 1,
|
||||||
cheques: [],
|
cheques: [],
|
||||||
products: {},
|
products: {},
|
||||||
},
|
},
|
||||||
@@ -134,10 +134,12 @@ export function Contract() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (inputForm.isValid() && isShipmentsMinimumValue()) {
|
if (inputForm.isValid() && isShipmentsMinimumValue()) {
|
||||||
|
const formValues = inputForm.getValues();
|
||||||
const contract = {
|
const contract = {
|
||||||
...inputForm.getValues(),
|
...formValues,
|
||||||
|
cheque_quantity: formValues.payment_method === "cheque" ? formValues.cheque_quantity : 0,
|
||||||
form_id: form.id,
|
form_id: form.id,
|
||||||
products: tranformProducts(withDefaultValues(inputForm.getValues().products)),
|
products: tranformProducts(withDefaultValues(formValues.products)),
|
||||||
};
|
};
|
||||||
await createContractMutation.mutateAsync(contract);
|
await createContractMutation.mutateAsync(contract);
|
||||||
window.location.href = '/';
|
window.location.href = '/';
|
||||||
|
|||||||
Reference in New Issue
Block a user