Smadger
Smadger
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Smadger on 8/25/2023 in #questions
stop env check on build
I'm building and deploying my app not on vercel. I build in a GitHub action so how can I disable the environment variable check there.
3 replies
TTCTheo's Typesafe Cult
Created by Smadger on 7/11/2023 in #questions
Call TRPC from an api
How can I call TRPC from my api backend?
4 replies
TTCTheo's Typesafe Cult
Created by Smadger on 7/2/2023 in #questions
Get types of return value from trpc api call
10 replies
TTCTheo's Typesafe Cult
Created by Smadger on 5/11/2023 in #questions
TRPC good practice, single schema, multiple similar updates.
I'm using TRPC and zod. I have two similar forms which update the user object in my database. On one I want to update firstName and lastName. On the other I want to update firstName, lastName and email. Should these two different updates be their own separate functions or should they be one which can share a schema.
4 replies
TTCTheo's Typesafe Cult
Created by Smadger on 2/6/2023 in #questions
Zod array of dates
Can someone help me validate that a variable is an array of exactly two dates and ideally in the future. Here is what I've currently got. However it allows an array of two nulls which isn't what I want.
date: z.array(z.date(), {
required_error: "Departure & Return Date is required",
invalid_type_error: "Departure & Return Date is required",
}),
date: z.array(z.date(), {
required_error: "Departure & Return Date is required",
invalid_type_error: "Departure & Return Date is required",
}),
9 replies
TTCTheo's Typesafe Cult
Created by Smadger on 11/7/2022 in #questions
Zod one or more values from an array
Thanks in advance, my mind has gone blank and I just cannot think at this point. How can I say with zod I want to have at least one value of these array of possible values passed through. So basically a multi select picklist.
7 replies
TTCTheo's Typesafe Cult
Created by Smadger on 10/9/2022 in #questions
NextAuth 2FA with oAuth
Just have a quick question about adding 2fa to oAuth providers with next-auth. Does anyone have any example code or advice for me? Ideally I'd like to continue to use the existing provider without having to re-write it..
1 replies