mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
rename api end url to bookings
This commit is contained in:
@@ -157,7 +157,7 @@ export default function BookProvider({ children }) {
|
||||
|
||||
try {
|
||||
const booking = await createBooking(state.formData)
|
||||
router.push(`/booking/${booking.uuid}/stored`)
|
||||
router.push(`/bookings/${booking.uuid}/stored`)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
dispatch({ type: ACTIONS.POST_DATA_ERROR, payload: error.message })
|
||||
|
||||
@@ -75,7 +75,7 @@ export async function createBill(
|
||||
bookingUuid: string,
|
||||
bill: Bill
|
||||
): Promise<Bill> {
|
||||
return fetch(`/api/booking/${bookingUuid}/bill`, {
|
||||
return fetch(`/api/bookings/${bookingUuid}/bill`, {
|
||||
method: 'POST',
|
||||
body: bill,
|
||||
})
|
||||
@@ -85,7 +85,7 @@ export async function patchBill(
|
||||
bookingUuid: string,
|
||||
bill: Bill
|
||||
): Promise<Bill> {
|
||||
return fetch(`/api/booking/${bookingUuid}/bill`, {
|
||||
return fetch(`/api/bookings/${bookingUuid}/bill`, {
|
||||
method: 'POST',
|
||||
body: bill,
|
||||
})
|
||||
|
||||
@@ -17,21 +17,21 @@ export function getBookingStatus(status: BOOKING_STATUS) {
|
||||
}
|
||||
|
||||
export async function createBooking(formData: object) {
|
||||
return fetch('/api/booking', {
|
||||
return fetch('/api/bookings', {
|
||||
method: 'POST',
|
||||
body: formData,
|
||||
})
|
||||
}
|
||||
|
||||
export async function cancelBooking(uuid: string) {
|
||||
return fetch(`/api/booking/${uuid}`, {
|
||||
return fetch(`/api/bookings/${uuid}`, {
|
||||
method: 'PATCH',
|
||||
body: { status: BOOKING_STATUS.CANCELED },
|
||||
})
|
||||
}
|
||||
|
||||
export async function patchBooking(uuid: string, bookingData: object) {
|
||||
return fetch(`/api/booking/${uuid}`, {
|
||||
return fetch(`/api/bookings/${uuid}`, {
|
||||
method: 'PATCH',
|
||||
body: { ...bookingData },
|
||||
})
|
||||
|
||||
@@ -23,7 +23,7 @@ export function generateCalendarEntry(booking: Booking): string {
|
||||
geo: { lat: 48.287044, lon: 8.726361 },
|
||||
description: `Gebucht auf ${booking.name}
|
||||
|
||||
Buchungs-Link: ${getBaseURL()}/booking/${booking.uuid}
|
||||
Buchungs-Link: ${getBaseURL()}/bookings/${booking.uuid}
|
||||
`,
|
||||
status:
|
||||
booking.status === BOOKING_STATUS.CONFIRMED
|
||||
@@ -61,7 +61,7 @@ Zeitraum: ${daysFormatFrontend(booking.days)}
|
||||
Email: ${booking.email}
|
||||
Telefon: ${booking.phone}
|
||||
|
||||
Link: ${getBaseURL()}/admin/booking/${booking.uuid}
|
||||
Link: ${getBaseURL()}/admin/bookings/${booking.uuid}
|
||||
`,
|
||||
status:
|
||||
booking.status === BOOKING_STATUS.CONFIRMED
|
||||
|
||||
@@ -40,7 +40,7 @@ Nach Prüfung bestätigen wir die Buchung bald per E-Mail!
|
||||
|
||||
Du kannst sie jederzeit unter
|
||||
|
||||
${getBaseURL()}/booking/${booking.uuid}
|
||||
${getBaseURL()}/bookings/${booking.uuid}
|
||||
|
||||
einsehen und auch stornieren.
|
||||
|
||||
@@ -58,7 +58,7 @@ deine Buchunganfrage zum ${daysFormatFrontend(
|
||||
Bitte melde dich spätestens 7 Tage vor dem Buchungstermin per E-Mail oder Telefon
|
||||
um eine Schlüsselübergabe zu vereinbaren.
|
||||
|
||||
Du kannst deine Buchung weiterhin unter ${getBaseURL()}/booking/${booking.uuid}
|
||||
Du kannst deine Buchung weiterhin unter ${getBaseURL()}/bookings/${booking.uuid}
|
||||
einsehen und stornieren.
|
||||
|
||||
${footer}
|
||||
@@ -81,7 +81,7 @@ ${footer}
|
||||
function getReceivedBookingAdminText(booking: { uuid: string }): string {
|
||||
return `Hallo lieber Admin,
|
||||
|
||||
es ging folgende Buchung ein: ${getBaseURL()}/admin/booking/${booking.uuid}
|
||||
es ging folgende Buchung ein: ${getBaseURL()}/admin/bookings/${booking.uuid}
|
||||
|
||||
MfG`
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export default function AdminRecentBookings({ bookings }) {
|
||||
>
|
||||
<div className="px-4 py-5 sm:px-6">
|
||||
<h3 className="text-lg leading-6 font-medium text-gray-900">
|
||||
<Link href={`/admin/booking/${booking.uuid}`}>
|
||||
<Link href={`/admin/bookings/${booking.uuid}`}>
|
||||
<a className="link">Booking {booking.uuid}</a>
|
||||
</Link>
|
||||
</h3>
|
||||
|
||||
@@ -23,13 +23,13 @@ export default function ShowBookingStored({ booking }: { booking: Booking }) {
|
||||
<>
|
||||
<Header />
|
||||
<main className="main">
|
||||
<h3 className="text-lg mb-3">Vielen Dank für die Buchungsanfrage</h3>
|
||||
<h3 className="mb-3 text-lg">Vielen Dank für die Buchungsanfrage</h3>
|
||||
<p className="mb-6">
|
||||
Nach Prüfung bestätigen wir die Buchung zeitnah per E-Mail.
|
||||
</p>
|
||||
<p>
|
||||
Den{' '}
|
||||
<Link href={`/booking/${booking.uuid}`}>
|
||||
<Link href={`/bookings/${booking.uuid}`}>
|
||||
<a className="link">Link</a>
|
||||
</Link>{' '}
|
||||
zur Buchung schicken wir Dir auch per E-Mail. Dort kann die Buchung
|
||||
@@ -41,7 +41,7 @@ export default function ShowBookingStored({ booking }: { booking: Booking }) {
|
||||
Sollen deine Buchungsdaten für die nächste Buchung in{' '}
|
||||
<strong>deinem Browser</strong> gespeichert werden?
|
||||
</p>
|
||||
<button onClick={store} className="btn btn-blue ml-0 mt-3">
|
||||
<button onClick={store} className="mt-3 ml-0 btn btn-blue">
|
||||
Ja, bitte speichern
|
||||
</button>
|
||||
</div>
|
||||
Reference in New Issue
Block a user