This commit is contained in:
@@ -109,7 +109,7 @@ export function ProductorModal({
|
|||||||
existing ?? {
|
existing ?? {
|
||||||
name,
|
name,
|
||||||
details: "",
|
details: "",
|
||||||
max: null,
|
max: "",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -58,6 +58,11 @@ export default function Productors() {
|
|||||||
async (productor: ProductorInputs) => {
|
async (productor: ProductorInputs) => {
|
||||||
await createProductorMutation.mutateAsync({
|
await createProductorMutation.mutateAsync({
|
||||||
...productor,
|
...productor,
|
||||||
|
payment_methods: productor.payment_methods.map((payment) =>( {
|
||||||
|
name: payment.name,
|
||||||
|
details: payment.details,
|
||||||
|
max: payment.max === "" ? null : payment.max
|
||||||
|
}))
|
||||||
});
|
});
|
||||||
closeModal();
|
closeModal();
|
||||||
},
|
},
|
||||||
@@ -69,7 +74,14 @@ export default function Productors() {
|
|||||||
if (!id) return;
|
if (!id) return;
|
||||||
await editProductorMutation.mutateAsync({
|
await editProductorMutation.mutateAsync({
|
||||||
id: id,
|
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();
|
closeModal();
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export const PaymentMethods = [
|
|||||||
export type PaymentMethod = {
|
export type PaymentMethod = {
|
||||||
name: string;
|
name: string;
|
||||||
details: string;
|
details: string;
|
||||||
max: number | null;
|
max: number | string | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Productor = {
|
export type Productor = {
|
||||||
|
|||||||
Reference in New Issue
Block a user