fix(build): oRPC Query/Mutation options korrekt verwendet (input wrapper), interne RPC-Client-Typisierung gelockert und createToken-Aufrufe angepasst
This commit is contained in:
@@ -59,18 +59,14 @@ export default function BookingStatusPage({ token }: BookingStatusPageProps) {
|
||||
const [cancellationResult, setCancellationResult] = useState<{ success: boolean; message: string; formattedDate?: string } | null>(null);
|
||||
|
||||
// Fetch booking details
|
||||
const { data: booking, isLoading, error, refetch } = useQuery({
|
||||
queryKey: ["booking", "status", token],
|
||||
// oRPC React Query Helper liefert .queryOptions()
|
||||
...queryClient.cancellation.getBookingByToken.queryOptions({ token }),
|
||||
retry: false,
|
||||
});
|
||||
const { data: booking, isLoading, error, refetch } = useQuery(
|
||||
queryClient.cancellation.getBookingByToken.queryOptions({ input: { token } })
|
||||
);
|
||||
|
||||
// Cancellation mutation
|
||||
const cancelMutation = useMutation({
|
||||
// oRPC React Query Helper liefert .mutationOptions()
|
||||
...queryClient.cancellation.cancelByToken.mutationOptions(),
|
||||
onSuccess: (result) => {
|
||||
onSuccess: (result: any) => {
|
||||
setCancellationResult({
|
||||
success: true,
|
||||
message: result.message,
|
||||
@@ -92,7 +88,7 @@ export default function BookingStatusPage({ token }: BookingStatusPageProps) {
|
||||
const handleCancel = () => {
|
||||
setIsCancelling(true);
|
||||
setCancellationResult(null);
|
||||
cancelMutation.mutate({ token });
|
||||
cancelMutation.mutate({ input: { token } });
|
||||
};
|
||||
|
||||
if (isLoading) {
|
||||
|
Reference in New Issue
Block a user