fix(build): Types in admin-calendar, oRPC React Query Helpers in booking-status, Router-Namenskonflikt, entferne unsupported allowedHosts aus Vite
This commit is contained in:
@@ -69,8 +69,8 @@ export function AdminCalendar() {
|
||||
const startDate = new Date(firstDay);
|
||||
startDate.setDate(startDate.getDate() - firstDay.getDay());
|
||||
|
||||
const calendarDays = [];
|
||||
const currentDate = new Date(startDate);
|
||||
const calendarDays: Date[] = [];
|
||||
const currentDate: Date = new Date(startDate);
|
||||
|
||||
for (let i = 0; i < 42; i++) {
|
||||
calendarDays.push(new Date(currentDate));
|
||||
|
@@ -61,13 +61,15 @@ export default function BookingStatusPage({ token }: BookingStatusPageProps) {
|
||||
// Fetch booking details
|
||||
const { data: booking, isLoading, error, refetch } = useQuery({
|
||||
queryKey: ["booking", "status", token],
|
||||
queryFn: () => queryClient.cancellation.getBookingByToken({ token }),
|
||||
// oRPC React Query Helper liefert .queryOptions()
|
||||
...queryClient.cancellation.getBookingByToken.queryOptions({ token }),
|
||||
retry: false,
|
||||
});
|
||||
|
||||
// Cancellation mutation
|
||||
const cancelMutation = useMutation({
|
||||
mutationFn: () => queryClient.cancellation.cancelByToken({ token }),
|
||||
// oRPC React Query Helper liefert .mutationOptions()
|
||||
...queryClient.cancellation.cancelByToken.mutationOptions(),
|
||||
onSuccess: (result) => {
|
||||
setCancellationResult({
|
||||
success: true,
|
||||
@@ -90,7 +92,7 @@ export default function BookingStatusPage({ token }: BookingStatusPageProps) {
|
||||
const handleCancel = () => {
|
||||
setIsCancelling(true);
|
||||
setCancellationResult(null);
|
||||
cancelMutation.mutate();
|
||||
cancelMutation.mutate({ token });
|
||||
};
|
||||
|
||||
if (isLoading) {
|
||||
|
Reference in New Issue
Block a user