perf: Remove slots router from publicViewer (#20128)

This commit is contained in:
Keith Williams authored and GitHub committed 2025-03-17 09:28:40 -07:00
1 parent db52f44293
commit 3be9e1bd38
4 files changed
+6 -9

No files matched your search

@@ -92,7 +92,7 @@ export const useSlots = (event: { data?: Pick<BookerEvent, "id" | "length"> | nu
shallow
);
const [slotReservationId, setSlotReservationId] = useSlotReservationId();
const reserveSlotMutation = trpc.viewer.public.slots.reserveSlot.useMutation({
const reserveSlotMutation = trpc.viewer.slots.reserveSlot.useMutation({
trpc: {
context: {
skipBatch: true,
@@ -102,7 +102,7 @@ export const useSlots = (event: { data?: Pick<BookerEvent, "id" | "length"> | nu
setSlotReservationId(data.uid);
},
});
const removeSelectedSlot = trpc.viewer.public.slots.removeSelectedSlotMark.useMutation({
const removeSelectedSlot = trpc.viewer.slots.removeSelectedSlotMark.useMutation({
trpc: { context: { skipBatch: true } },
});
@@ -1,7 +1,7 @@
import type { RouterOutputs } from "@calcom/trpc/react";
export type Slots = RouterOutputs["viewer"]["public"]["slots"]["getSchedule"]["slots"];
export type Slots = RouterOutputs["viewer"]["slots"]["getSchedule"]["slots"];
export type Slot = Slots[string][number] & { showConfirmButton?: boolean };
export type GetSchedule = RouterOutputs["viewer"]["public"]["slots"]["getSchedule"];
export type GetSchedule = RouterOutputs["viewer"]["slots"]["getSchedule"];
@@ -109,7 +109,7 @@ export const useSchedule = ({
if (isTeamEvent) {
schedule = trpc.viewer.highPerf.getTeamSchedule.useQuery(input, options);
} else {
schedule = trpc.viewer.public.slots.getSchedule.useQuery(input, options);
schedule = trpc.viewer.slots.getSchedule.useQuery(input, options);
}
return {
...schedule,
@@ -117,7 +117,7 @@ export const useSchedule = ({
* Invalidates the request and resends it regardless of any other configuration including staleTime
*/
invalidate: () => {
return utils.viewer.public.slots.getSchedule.invalidate(input);
return utils.viewer.slots.getSchedule.invalidate(input);
},
};
};
@@ -1,6 +1,5 @@
import publicProcedure from "../../procedures/publicProcedure";
import { importHandler, router } from "../../trpc";
import { slotsRouter } from "../viewer/slots/_router";
import { ZUserEmailVerificationRequiredSchema } from "./checkIfUserEmailVerificationRequired.schema";
import { ZMarkHostAsNoShowInputSchema } from "./markHostAsNoShow.schema";
import { event } from "./procedures/event";
@@ -45,8 +44,6 @@ export const publicViewerRouter = router({
);
return handler(opts);
}),
// REVIEW: This router is part of both the public and private viewer router?
slots: slotsRouter,
event,
ssoConnections: publicProcedure.query(async () => {
const handler = await importHandler(