Close dialog on status change

This commit is contained in:
Jose Selesan
2026-05-06 17:03:42 -03:00
parent 41a217e8a9
commit 7be776f189
22 changed files with 408 additions and 428 deletions

View File

@@ -494,7 +494,7 @@ export async function updateAdminBookingStatus(
);
}
if(input.status === 'NOSHOW' && booking.status !== 'CONFIRMED') {
if (input.status === 'NOSHOW' && booking.status !== 'CONFIRMED') {
throw new AdminBookingServiceError(
'Solo se pueden marcar como no show las reservas confirmadas.',
409
@@ -517,7 +517,7 @@ export async function updateAdminBookingStatus(
},
});
if(input.status === 'COMPLETED' || input.status ==='NOSHOW') {
if (input.status === 'COMPLETED' || input.status === 'NOSHOW') {
await db.courtBooking.update({
where: { id: booking.id },
data: {
@@ -528,8 +528,8 @@ export async function updateAdminBookingStatus(
// if the booking is cancelled we delete it to free up the slot, but we keep a log of it with the cancelled status
await db.courtBooking.delete({
where: { id: booking.id },
})
});
}
return mapBookingResponse({...booking, status: input.status });
return mapBookingResponse({ ...booking, status: input.status });
}