Skip to content

Commit

Permalink
same method for cancellation and delete & no empty strings in request…
Browse files Browse the repository at this point in the history
… body
  • Loading branch information
DovMa committed Jan 17, 2024
1 parent 9fa6d72 commit 48518d4
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/components/forms/Registration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const RegistrationForm = ({
...callBacks,
});

const deleteFishStockingMutation = useMutation(() => api.deleteFishStocking(id!), {
const deleteFishStockingMutation = useMutation(() => api.cancelFishStocking(id!), {
...callBacks,
});

Expand Down Expand Up @@ -145,22 +145,22 @@ const RegistrationForm = ({
} = values;
const params = {
eventTime,
phone,
phone: phone || undefined,
geom,
assignedTo: assignedTo?.id,
stockingCustomer: stockingCustomer?.id,
location: location,
fishOrigin,
fishOrigin: fishOrigin.toUpperCase(),
fishOriginCompanyName,
...(fishOriginReservoir && {
fishOriginReservoir,
}),
batches: batches.map((batch) => {
return {
amount: batch.amount,
weight: batch.weight,
fishType: batch?.fishType?.id,
fishAge: batch?.fishAge?.id,
amount: batch.amount || undefined,
weight: batch.weight || undefined,
fishType: batch?.fishType?.id || undefined,
fishAge: batch?.fishAge?.id || undefined,
};
}),
};
Expand Down

0 comments on commit 48518d4

Please sign in to comment.