cookie's now only used under /admin

This commit is contained in:
Thomas Ruoff
2024-09-11 23:44:31 +02:00
parent c671b622d5
commit af3262e55e
8 changed files with 77 additions and 61 deletions

View File

@@ -9,6 +9,7 @@ import { log } from '../../../../helpers/log'
import { getBillTotal, createBill, patchBill } from '../../../../helpers/bill'
import { getBookingStatus } from '../../../../helpers/booking'
import { getServerSideBooking } from '../../../../lib/getServerSideProps'
import withAuth from '../../../../helpers/withAuth'
export const getServerSideProps = async (context) => {
const milageMax = await getMilageMax()
@@ -114,14 +115,14 @@ function BookingBillPage({
setStoringInProgress(false)
}
const onAddAdditionalCost = function(
const onAddAdditionalCost = function (
event: React.MouseEvent<HTMLButtonElement>
) {
event.preventDefault()
setAdditionalCosts([...additionalCosts, { name: '', value: 0 }])
}
const onRemoveAdditionalCost = function(
const onRemoveAdditionalCost = function (
event: React.MouseEvent<HTMLButtonElement>,
index: number
) {
@@ -197,8 +198,9 @@ function BookingBillPage({
>
-
</button>
<label className="flabel inline">{`Kostenpunkt ${index + 1
}`}</label>
<label className="flabel inline">{`Kostenpunkt ${
index + 1
}`}</label>
</div>
<div className="ml-10 mb-3" key={`input{index}`}>
<Input
@@ -262,4 +264,4 @@ function BookingBillPage({
BookingBillPage.authenticationRequired = true
export default BookingBillPage
export default withAuth(BookingBillPage)

View File

@@ -8,6 +8,7 @@ import { patchBooking } from '../../../../helpers/booking'
import { log } from '../../../../helpers/log'
import { BOOKING_STATUS } from '../../../../db/enums'
import BookingTable from '../../../../components/bookingTable'
import withAuth from '../../../../helpers/withAuth'
export const getServerSideProps = getServerSideBooking
@@ -73,4 +74,4 @@ function ShowBookingAdmin({ booking: bookingProp }: { booking: IBooking }) {
ShowBookingAdmin.authenticationRequired = true
export default ShowBookingAdmin
export default withAuth(ShowBookingAdmin)

View File

@@ -1,5 +1,7 @@
import React from 'react'
import React, { ReactElement } from 'react'
import BookingTable from '../../components/bookingTable'
import Layout from '../../components/layout'
import withAuth from '../../helpers/withAuth'
import { getServerSideRecentBookings } from '../../lib/getServerSideProps'
@@ -23,6 +25,4 @@ function AdminRecentBookings({ bookings }) {
)
}
AdminRecentBookings.authenticationRequired = true
export default AdminRecentBookings
export default withAuth(AdminRecentBookings)