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: "",
|
||||
phone: "",
|
||||
payment_method: "",
|
||||
cheque_quantity: 0,
|
||||
cheque_quantity: 1,
|
||||
cheques: [],
|
||||
products: {},
|
||||
},
|
||||
@@ -134,10 +134,12 @@ export function Contract() {
|
||||
return;
|
||||
}
|
||||
if (inputForm.isValid() && isShipmentsMinimumValue()) {
|
||||
const formValues = inputForm.getValues();
|
||||
const contract = {
|
||||
...inputForm.getValues(),
|
||||
...formValues,
|
||||
cheque_quantity: formValues.payment_method === "cheque" ? formValues.cheque_quantity : 0,
|
||||
form_id: form.id,
|
||||
products: tranformProducts(withDefaultValues(inputForm.getValues().products)),
|
||||
products: tranformProducts(withDefaultValues(formValues.products)),
|
||||
};
|
||||
await createContractMutation.mutateAsync(contract);
|
||||
window.location.href = '/';
|
||||
|
||||
Reference in New Issue
Block a user