From 8c252cca2b4ee2dd4c6d8d9e8b922b9ec3457be5 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Mon, 2 Nov 2020 23:24:30 +0100 Subject: [PATCH] make getBookingStatus work without a booking --- helpers/booking.ts | 4 ++-- pages/admin/booking/[uuid]/bill.tsx | 7 ++++--- pages/booking/[uuid]/index.tsx | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/helpers/booking.ts b/helpers/booking.ts index af0f394..53a62c4 100644 --- a/helpers/booking.ts +++ b/helpers/booking.ts @@ -1,7 +1,7 @@ import { BOOKING_STATUS } from '../db/enums' -export function getBookingStatus(booking: { status: BOOKING_STATUS }) { - switch (booking.status) { +export function getBookingStatus(status: BOOKING_STATUS) { + switch (status) { case BOOKING_STATUS.REQUESTED: return 'Angefragt' case BOOKING_STATUS.CONFIRMED: diff --git a/pages/admin/booking/[uuid]/bill.tsx b/pages/admin/booking/[uuid]/bill.tsx index 675ed89..eac6bef 100644 --- a/pages/admin/booking/[uuid]/bill.tsx +++ b/pages/admin/booking/[uuid]/bill.tsx @@ -48,7 +48,7 @@ const milageTarifOptions = Object.values(MILAGE_TARIFS).map((tarif) => { ) }) -const bookingStatusOptions = Object.values(BILL_STATUS).map((status) => { +const billStatusOptions = Object.values(BILL_STATUS).map((status) => { return (