mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 21:08:12 +00:00
Ticket generation issue resolution
This commit is contained in:
@@ -81,15 +81,6 @@ function BookingsPageContent() {
|
||||
const forceConfirmMutation = useMutation({
|
||||
mutationFn: ({ bookingId, data }: { bookingId: string; data: { paymentReference?: string; paymentMethod?: string; notes?: string } }) =>
|
||||
bookingsApi.forceConfirm(bookingId, data),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['bookings'] });
|
||||
setSuccessMessage('Payment confirmed and ticket generated successfully');
|
||||
setTimeout(() => setSuccessMessage(''), 4000);
|
||||
setSelectedBooking(null);
|
||||
setGenerateTicketBooking(null);
|
||||
setGenerateTicketForm({ paymentReference: '', paymentMethod: '', notes: '' });
|
||||
setGenerateTicketTouched({ paymentReference: false, paymentMethod: false });
|
||||
},
|
||||
});
|
||||
|
||||
const deleteMutation = useMutation({
|
||||
@@ -649,7 +640,13 @@ function BookingsPageContent() {
|
||||
setGenerateTicketTouched({ paymentReference: true, paymentMethod: true });
|
||||
if (!generateTicketForm.paymentReference || !generateTicketForm.paymentMethod) return;
|
||||
forceConfirmMutation.reset();
|
||||
smartAssignMutation.mutate(generateTicketBooking.id);
|
||||
smartAssignMutation.reset();
|
||||
forceConfirmMutation.mutate(
|
||||
{ bookingId: generateTicketBooking.id, data: { paymentReference: generateTicketForm.paymentReference, paymentMethod: generateTicketForm.paymentMethod, notes: generateTicketForm.notes } },
|
||||
{
|
||||
onSuccess: () => smartAssignMutation.mutate(generateTicketBooking.id),
|
||||
},
|
||||
);
|
||||
}}
|
||||
disabled={forceConfirmMutation.isPending || smartAssignMutation.isPending}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user