9bd3781c03
Cast Zod schemas with .refine()/.superRefine() to z.ZodType<InferredType> at the procedure level. This short-circuits TypeScript's deep type recursion through tRPC's middleware chain, eliminating 4 of 5 @ts-expect-error TS2589 suppressions in web components (VacationModal, ProjectModal, UsersClient, CountriesClient). Applied same pattern to allocation, timeline, staffing, dashboard, project, and resource query/mutation procedures to reduce client-side type depth. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
19 lines
680 B
TypeScript
19 lines
680 B
TypeScript
import { createTRPCRouter, protectedProcedure } from "../trpc.js";
|
|
import type { z } from "zod";
|
|
import {
|
|
createVacationRequest,
|
|
CreateVacationRequestSchema,
|
|
type CreateVacationRequestInput,
|
|
} from "./vacation-create-support.js";
|
|
import { vacationManagementProcedures } from "./vacation-management-procedures.js";
|
|
import { vacationReadProcedures } from "./vacation-read.js";
|
|
|
|
export const vacationRouter = createTRPCRouter({
|
|
...vacationReadProcedures,
|
|
...vacationManagementProcedures,
|
|
|
|
create: protectedProcedure
|
|
.input(CreateVacationRequestSchema as z.ZodType<CreateVacationRequestInput>)
|
|
.mutation(({ ctx, input }) => createVacationRequest(ctx, input)),
|
|
});
|