mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
remover booker, that's overdosed
It also brings the problem of consolidating bookers over multiple bookings. The amount of data is not justifying having it in an own entity
This commit is contained in:
@@ -158,7 +158,7 @@ export default function BookingBillPage({
|
||||
{daysFormatFrontend(booking.days)}
|
||||
</div>
|
||||
<div>
|
||||
<strong>Bucher:</strong> {booking.booker.name}
|
||||
<strong>Bucher:</strong> {booking.name}
|
||||
</div>
|
||||
<div>
|
||||
<strong>Buchungsstatus:</strong>{' '}
|
||||
|
||||
@@ -74,7 +74,7 @@ export default function ShowBookingAdmin({
|
||||
<strong>Buchungszeitraum:</strong> {daysFormatFrontend(booking.days)}
|
||||
</div>
|
||||
<div>
|
||||
<strong>Bucher:</strong> {booking.booker.name}
|
||||
<strong>Bucher:</strong> {booking.name}
|
||||
</div>
|
||||
<div>
|
||||
<strong>Buchungsstatus:</strong> {getBookingStatus(booking.status)}
|
||||
|
||||
@@ -59,13 +59,13 @@ export default function AdminRecentBookings({ bookings }) {
|
||||
<div className="bg-white px-2 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
||||
<dt className="text-sm font-medium text-gray-500">Bucher</dt>
|
||||
<dd className="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
||||
{booking.booker.name}
|
||||
{booking.name}
|
||||
</dd>
|
||||
</div>
|
||||
<div className="bg-gray-100 px-2 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
||||
<dt className="text-sm font-medium text-gray-500">Email</dt>
|
||||
<dd className="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-2">
|
||||
{booking.booker.email}
|
||||
{booking.email}
|
||||
</dd>
|
||||
</div>
|
||||
<div className="bg-white px-2 py-3 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
||||
|
||||
@@ -51,7 +51,6 @@ export default withSession(async function userHandler(
|
||||
booking.set(req.body)
|
||||
try {
|
||||
await booking.save()
|
||||
await booking.populate('booker').execPopulate()
|
||||
res.status(200).json(booking.toJSON())
|
||||
} catch (error) {
|
||||
res.status(400).end(`Failed to save booking: ${error.message}`)
|
||||
|
||||
@@ -30,15 +30,11 @@ export default async function userHandler(
|
||||
return
|
||||
}
|
||||
|
||||
console.log(
|
||||
`received booking ${booking.uuid} from {booking.booker.email}`
|
||||
)
|
||||
console.log(`received booking ${booking.uuid} from {booking.email}`)
|
||||
await sendReceivedBookingAdminMail(booking)
|
||||
console.log(`send booking ${booking.uuid} received to admin`)
|
||||
await sendReceivedBookingBookerMail(booking)
|
||||
console.log(
|
||||
`send booking ${booking.uuid} received to {booking.booker.email}`
|
||||
)
|
||||
console.log(`send booking ${booking.uuid} received to {booking.email}`)
|
||||
break
|
||||
default:
|
||||
res.setHeader('Allow', ['POST'])
|
||||
|
||||
Reference in New Issue
Block a user