- Changed all zod imports from "zod" to "zod/v4" across multiple files. - Updated error handling in forms to use new zod error configuration. - Refactored custom error mapping to align with zod v4 changes. - Adjusted password validation logic to utilize new zod features. - Cleaned up unused locale error mapping code. - Enhanced type definitions for async iterables in zod utility functions.
27 lines
667 B
TypeScript
27 lines
667 B
TypeScript
import { z } from "zod/v4";
|
|
import {
|
|
createTRPCRouter,
|
|
protectedApiProcedure,
|
|
publicProcedure,
|
|
} from "~/server/api/trpc";
|
|
import {
|
|
addEventToQueue,
|
|
processEvents,
|
|
} from "~/server/controllers/event_queue.controller";
|
|
import { zEventDataTypes } from "~/server/utils/zod_types";
|
|
|
|
export const eventQueueRouter = createTRPCRouter({
|
|
addEvent: publicProcedure
|
|
.input(
|
|
z.object({
|
|
lock_expires: z.date(),
|
|
data: zEventDataTypes,
|
|
}),
|
|
)
|
|
.mutation(async ({ input }) => {
|
|
return await addEventToQueue(input);
|
|
}),
|
|
processEvents: protectedApiProcedure.query(async () => {
|
|
return await processEvents();
|
|
}),
|
|
});
|