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 {
|
try {
|
||||||
const booking = await createBooking(state.formData)
|
const booking = await createBooking(state.formData)
|
||||||
router.push(`/booking/${booking.uuid}/stored`)
|
router.push(`/bookings/${booking.uuid}/stored`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
dispatch({ type: ACTIONS.POST_DATA_ERROR, payload: error.message })
|
dispatch({ type: ACTIONS.POST_DATA_ERROR, payload: error.message })
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export async function createBill(
|
|||||||
bookingUuid: string,
|
bookingUuid: string,
|
||||||
bill: Bill
|
bill: Bill
|
||||||
): Promise<Bill> {
|
): Promise<Bill> {
|
||||||
return fetch(`/api/booking/${bookingUuid}/bill`, {
|
return fetch(`/api/bookings/${bookingUuid}/bill`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: bill,
|
body: bill,
|
||||||
})
|
})
|
||||||
@@ -85,7 +85,7 @@ export async function patchBill(
|
|||||||
bookingUuid: string,
|
bookingUuid: string,
|
||||||
bill: Bill
|
bill: Bill
|
||||||
): Promise<Bill> {
|
): Promise<Bill> {
|
||||||
return fetch(`/api/booking/${bookingUuid}/bill`, {
|
return fetch(`/api/bookings/${bookingUuid}/bill`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: bill,
|
body: bill,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -17,21 +17,21 @@ export function getBookingStatus(status: BOOKING_STATUS) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function createBooking(formData: object) {
|
export async function createBooking(formData: object) {
|
||||||
return fetch('/api/booking', {
|
return fetch('/api/bookings', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: formData,
|
body: formData,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function cancelBooking(uuid: string) {
|
export async function cancelBooking(uuid: string) {
|
||||||
return fetch(`/api/booking/${uuid}`, {
|
return fetch(`/api/bookings/${uuid}`, {
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
body: { status: BOOKING_STATUS.CANCELED },
|
body: { status: BOOKING_STATUS.CANCELED },
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function patchBooking(uuid: string, bookingData: object) {
|
export async function patchBooking(uuid: string, bookingData: object) {
|
||||||
return fetch(`/api/booking/${uuid}`, {
|
return fetch(`/api/bookings/${uuid}`, {
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
body: { ...bookingData },
|
body: { ...bookingData },
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export function generateCalendarEntry(booking: Booking): string {
|
|||||||
geo: { lat: 48.287044, lon: 8.726361 },
|
geo: { lat: 48.287044, lon: 8.726361 },
|
||||||
description: `Gebucht auf ${booking.name}
|
description: `Gebucht auf ${booking.name}
|
||||||
|
|
||||||
Buchungs-Link: ${getBaseURL()}/booking/${booking.uuid}
|
Buchungs-Link: ${getBaseURL()}/bookings/${booking.uuid}
|
||||||
`,
|
`,
|
||||||
status:
|
status:
|
||||||
booking.status === BOOKING_STATUS.CONFIRMED
|
booking.status === BOOKING_STATUS.CONFIRMED
|
||||||
@@ -61,7 +61,7 @@ Zeitraum: ${daysFormatFrontend(booking.days)}
|
|||||||
Email: ${booking.email}
|
Email: ${booking.email}
|
||||||
Telefon: ${booking.phone}
|
Telefon: ${booking.phone}
|
||||||
|
|
||||||
Link: ${getBaseURL()}/admin/booking/${booking.uuid}
|
Link: ${getBaseURL()}/admin/bookings/${booking.uuid}
|
||||||
`,
|
`,
|
||||||
status:
|
status:
|
||||||
booking.status === BOOKING_STATUS.CONFIRMED
|
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
|
Du kannst sie jederzeit unter
|
||||||
|
|
||||||
${getBaseURL()}/booking/${booking.uuid}
|
${getBaseURL()}/bookings/${booking.uuid}
|
||||||
|
|
||||||
einsehen und auch stornieren.
|
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
|
Bitte melde dich spätestens 7 Tage vor dem Buchungstermin per E-Mail oder Telefon
|
||||||
um eine Schlüsselübergabe zu vereinbaren.
|
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.
|
einsehen und stornieren.
|
||||||
|
|
||||||
${footer}
|
${footer}
|
||||||
@@ -81,7 +81,7 @@ ${footer}
|
|||||||
function getReceivedBookingAdminText(booking: { uuid: string }): string {
|
function getReceivedBookingAdminText(booking: { uuid: string }): string {
|
||||||
return `Hallo lieber Admin,
|
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`
|
MfG`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export default function AdminRecentBookings({ bookings }) {
|
|||||||
>
|
>
|
||||||
<div className="px-4 py-5 sm:px-6">
|
<div className="px-4 py-5 sm:px-6">
|
||||||
<h3 className="text-lg leading-6 font-medium text-gray-900">
|
<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>
|
<a className="link">Booking {booking.uuid}</a>
|
||||||
</Link>
|
</Link>
|
||||||
</h3>
|
</h3>
|
||||||
|
|||||||
@@ -23,13 +23,13 @@ export default function ShowBookingStored({ booking }: { booking: Booking }) {
|
|||||||
<>
|
<>
|
||||||
<Header />
|
<Header />
|
||||||
<main className="main">
|
<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">
|
<p className="mb-6">
|
||||||
Nach Prüfung bestätigen wir die Buchung zeitnah per E-Mail.
|
Nach Prüfung bestätigen wir die Buchung zeitnah per E-Mail.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Den{' '}
|
Den{' '}
|
||||||
<Link href={`/booking/${booking.uuid}`}>
|
<Link href={`/bookings/${booking.uuid}`}>
|
||||||
<a className="link">Link</a>
|
<a className="link">Link</a>
|
||||||
</Link>{' '}
|
</Link>{' '}
|
||||||
zur Buchung schicken wir Dir auch per E-Mail. Dort kann die Buchung
|
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{' '}
|
Sollen deine Buchungsdaten für die nächste Buchung in{' '}
|
||||||
<strong>deinem Browser</strong> gespeichert werden?
|
<strong>deinem Browser</strong> gespeichert werden?
|
||||||
</p>
|
</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
|
Ja, bitte speichern
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
Reference in New Issue
Block a user