add booking status to bill

This commit is contained in:
Thomas Ruoff
2020-10-10 01:01:46 +02:00
parent e029547fe1
commit a5b47a7311
3 changed files with 20 additions and 15 deletions

View File

@@ -29,21 +29,6 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
}
}
function getBookingStatus(booking: BookingDocument) {
switch (booking.status) {
case BOOKING_STATUS.REQUESTED:
return 'In Bearbeitung'
case BOOKING_STATUS.CONFIRMED:
return 'Bestätigt'
case BOOKING_STATUS.REJECTED:
return 'Abgewiesen'
case BOOKING_STATUS.CANCELED:
return 'Storniert'
default:
return 'Unbekannt - bitte kontaktieren Sie uns!'
}
}
async function cancelBooking(booking: BookingDocument) {
const response = await fetch(`/api/booking/${booking.uuid}`, {
method: 'PATCH',