mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
cookie's now only used under /admin
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user