mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-05 07:27:12 +01:00
rip out all old auth data
This commit is contained in:
committed by
Thomas Ruoff
parent
b257bc8258
commit
0e84945ab4
@@ -9,32 +9,18 @@ import { getMilageMax } from '../../../../db/index'
|
||||
import { daysFormatFrontend } from '../../../../helpers/date'
|
||||
import { getBillTotal, createBill, patchBill } from '../../../../helpers/bill'
|
||||
import { getBookingStatus } from '../../../../helpers/booking'
|
||||
import withSession, {
|
||||
isAdminSession,
|
||||
redirectToLogin,
|
||||
} from '../../../../lib/session'
|
||||
import { getServerSideBooking } from '../../../../lib/getServerSideProps'
|
||||
|
||||
export const getServerSideProps = withSession(async (context) => {
|
||||
const { req, res } = context
|
||||
|
||||
const adminUser = isAdminSession(req)
|
||||
|
||||
if (!adminUser) {
|
||||
redirectToLogin(req, res)
|
||||
return { props: {} }
|
||||
}
|
||||
|
||||
export const getServerSideProps = async (context) => {
|
||||
const milageMax = await getMilageMax()
|
||||
const serverSideBookingProps = await getServerSideBooking(context)
|
||||
return {
|
||||
props: {
|
||||
...serverSideBookingProps.props,
|
||||
milageMax,
|
||||
user: adminUser,
|
||||
},
|
||||
}
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
const milageTarifOptions = Object.values(MILAGE_TARIFS).map((tarif) => {
|
||||
return (
|
||||
@@ -217,9 +203,8 @@ export default 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
|
||||
|
||||
Reference in New Issue
Block a user