fix(build): oRPC Query/Mutation options korrekt verwendet (input wrapper), interne RPC-Client-Typisierung gelockert und createToken-Aufrufe angepasst

This commit is contained in:
2025-10-01 21:39:40 +02:00
parent fb30bb6395
commit 73612caa1e
2 changed files with 9 additions and 12 deletions

View File

@@ -13,7 +13,8 @@ import { validateEmail } from "@/server/lib/email-validator";
// Create a server-side client to call other RPC endpoints
const link = new RPCLink({ url: "http://localhost:5173/rpc" });
const queryClient = createORPCClient<typeof rootRouter>(link);
// Typisierung über any, um Build-Inkompatibilität mit NestedClient zu vermeiden (nur für interne Server-Calls)
const queryClient = createORPCClient<any>(link);
// Helper function to convert date from yyyy-mm-dd to dd.mm.yyyy
function formatDateGerman(dateString: string): string {
@@ -149,7 +150,7 @@ const create = os
// Notify customer: request received (pending)
void (async () => {
// Create booking access token for status viewing
const bookingAccessToken = await queryClient.cancellation.createToken({ bookingId: id });
const bookingAccessToken = await queryClient.cancellation.createToken({ input: { bookingId: id } });
const bookingUrl = generateUrl(`/booking/${bookingAccessToken.token}`);
const formattedDate = formatDateGerman(input.appointmentDate);
@@ -292,7 +293,7 @@ const updateStatus = os
try {
if (input.status === "confirmed") {
// Create booking access token for this booking (status + cancellation)
const bookingAccessToken = await queryClient.cancellation.createToken({ bookingId: booking.id });
const bookingAccessToken = await queryClient.cancellation.createToken({ input: { bookingId: booking.id } });
const formattedDate = formatDateGerman(booking.appointmentDate);
const bookingUrl = generateUrl(`/booking/${bookingAccessToken.token}`);