mirror of
https://github.com/hanzoai/calendar.git
synced 2026-10-30 14:46:43 +00:00
* perf: Move OOO-related tRPC procedures to new routers * Moved test file * push fix for import path in tests * fix trpc response url that we wait for --------- Co-authored-by: sean-brydon <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]> Co-authored-by: sean-brydon <[email protected]>
27 lines
1.3 KiB
TypeScript
27 lines
1.3 KiB
TypeScript
import authedProcedure from "../../../procedures/authedProcedure";
|
|
import { router } from "../../../trpc";
|
|
import { ZOutOfOfficeInputSchema } from "./outOfOfficeCreateOrUpdate.schema";
|
|
import { ZOutOfOfficeEntriesListSchema } from "./outOfOfficeEntriesList.schema";
|
|
import { ZOutOfOfficeDelete } from "./outOfOfficeEntryDelete.schema";
|
|
|
|
export const oooRouter = router({
|
|
outOfOfficeCreateOrUpdate: authedProcedure
|
|
.input(ZOutOfOfficeInputSchema)
|
|
.mutation(async ({ ctx, input }) => {
|
|
const handler = (await import("./outOfOfficeCreateOrUpdate.handler")).outOfOfficeCreateOrUpdate;
|
|
return handler({ ctx, input });
|
|
}),
|
|
outOfOfficeEntryDelete: authedProcedure.input(ZOutOfOfficeDelete).mutation(async ({ ctx, input }) => {
|
|
const handler = (await import("./outOfOfficeEntryDelete.handler")).outOfOfficeEntryDelete;
|
|
return handler({ ctx, input });
|
|
}),
|
|
outOfOfficeEntriesList: authedProcedure.input(ZOutOfOfficeEntriesListSchema).query(async (opts) => {
|
|
const handler = (await import("./outOfOfficeEntriesList.handler")).outOfOfficeEntriesList;
|
|
return handler(opts);
|
|
}),
|
|
outOfOfficeReasonList: authedProcedure.query(async () => {
|
|
const handler = (await import("./outOfOfficeReasons.handler")).outOfOfficeReasonList;
|
|
return handler();
|
|
}),
|
|
});
|