Alex
Alex
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Alex on 7/25/2023 in #questions
Error when using clerk getAuth from UploadThing routes
16 replies
TtRPC
Created by Alex on 6/27/2023 in #❓-help
Running TRPC on Vercel with custom serialization fails
Hi all, I'm having some difficulties with the serialization of my objects when I run on vercel. I'm running nextjs 13.4.4 with trpc/server,client,next 10.28.1 and the next page routing. I'm using a custom type "ts-money" which is returned in a trpc response like:
getSalaryEnvironment: protectedProcedure
.input(
z.object({
administratorId: z.string(),
salaryDate: salaryDateSchema,
}),
)
.query(async ({ input }) => {
return {
date: new Date(2023, 5, 31),
nbrOfDaysWorked: 20,
salaryDate: input.salaryDate,
totalGrossIncomeFromPreviousSalaryInYear: new Money(6000000,Currencies.EUR),
}
}),
getSalaryEnvironment: protectedProcedure
.input(
z.object({
administratorId: z.string(),
salaryDate: salaryDateSchema,
}),
)
.query(async ({ input }) => {
return {
date: new Date(2023, 5, 31),
nbrOfDaysWorked: 20,
salaryDate: input.salaryDate,
totalGrossIncomeFromPreviousSalaryInYear: new Money(6000000,Currencies.EUR),
}
}),
8 replies