Close dialog on status change
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user