Files
cal.diy/packages/app-store/basecamp3/trpc/_router.ts
T
6a1325867e fix: Fix all TS warnings (fix-tsWarnings) (#12139)
Co-authored-by: gitstart-calcom <[email protected]>
Co-authored-by: GitStart-Cal.com <[email protected]>
Co-authored-by: Peer Richelsen <[email protected]>
2024-01-03 18:18:42 -07:00

27 lines
1.0 KiB
TypeScript

import authedProcedure from "@calcom/trpc/server/procedures/authedProcedure";
import { router } from "@calcom/trpc/server/trpc";
import { ZProjectMutationInputSchema } from "./projectMutation.schema";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const UNSTABLE_HANDLER_CACHE: any = {};
const appBasecamp3 = router({
projects: authedProcedure.query(async ({ ctx }) => {
if (!UNSTABLE_HANDLER_CACHE.projects) {
UNSTABLE_HANDLER_CACHE.projects = await import("./projects.handler").then((mod) => mod.projectHandler);
}
return UNSTABLE_HANDLER_CACHE.projects({ ctx });
}),
projectMutation: authedProcedure.input(ZProjectMutationInputSchema).mutation(async ({ ctx, input }) => {
if (!UNSTABLE_HANDLER_CACHE.projectMutation) {
UNSTABLE_HANDLER_CACHE.projectMutation = await import("./projectMutation.handler").then(
(mod) => mod.projectMutationHandler
);
}
return UNSTABLE_HANDLER_CACHE.projectMutation({ ctx, input });
}),
});
export default appBasecamp3;