Merge branch 'main' of gitea.aldon.fr:Mop/amap
All checks were successful
Deploy Amap / deploy (push) Successful in 35s
All checks were successful
Deploy Amap / deploy (push) Successful in 35s
This commit is contained in:
@@ -57,7 +57,7 @@ export function ContractCheque({ inputForm, price, productor }: ContractChequePr
|
||||
{ capfirst: true },
|
||||
)}
|
||||
min={1}
|
||||
max={paymentMethod?.max || 3}
|
||||
max={paymentMethod?.max && paymentMethod?.max !== "" ? Number(paymentMethod?.max) : 3}
|
||||
{...inputForm.getInputProps(`cheque_quantity`)}
|
||||
/>
|
||||
<Group grow>
|
||||
|
||||
@@ -109,7 +109,7 @@ export function ProductorModal({
|
||||
existing ?? {
|
||||
name,
|
||||
details: "",
|
||||
max: null,
|
||||
max: "",
|
||||
}
|
||||
);
|
||||
}),
|
||||
|
||||
@@ -58,6 +58,11 @@ export default function Productors() {
|
||||
async (productor: ProductorInputs) => {
|
||||
await createProductorMutation.mutateAsync({
|
||||
...productor,
|
||||
payment_methods: productor.payment_methods.map((payment) =>( {
|
||||
name: payment.name,
|
||||
details: payment.details,
|
||||
max: payment.max === "" ? null : payment.max
|
||||
}))
|
||||
});
|
||||
closeModal();
|
||||
},
|
||||
@@ -69,7 +74,14 @@ export default function Productors() {
|
||||
if (!id) return;
|
||||
await editProductorMutation.mutateAsync({
|
||||
id: id,
|
||||
productor: productor,
|
||||
productor: {
|
||||
...productor,
|
||||
payment_methods: productor.payment_methods.map((payment) =>( {
|
||||
name: payment.name,
|
||||
details: payment.details,
|
||||
max: payment.max === "" ? null : payment.max
|
||||
}))
|
||||
},
|
||||
});
|
||||
closeModal();
|
||||
},
|
||||
|
||||
@@ -9,7 +9,7 @@ export const PaymentMethods = [
|
||||
export type PaymentMethod = {
|
||||
name: string;
|
||||
details: string;
|
||||
max: number | null;
|
||||
max: number | string | null;
|
||||
};
|
||||
|
||||
export type Productor = {
|
||||
|
||||
Reference in New Issue
Block a user