zd
zd
Explore posts from servers
DTDrizzle Team
Created by Cetus 🔛🔝 on 10/26/2023 in #help
drizzle-zod refine enum
I couldn't get schema.<field>.describe to do anything. I wound up with (using @Cetus 🔛🔝's example) ... role: () => z.enum(['USER', 'ADMIN'], { required_error: "Please select a role" }), //in createInsertSchema ... But this feels like I'm completely redefining the schema which I don't love. For example, I could do the following and have a mismatch between the schema and table definition. role: () => z.enum(['USER', 'ADMIN', 'NEW-SUPER-ADMIN'], { required_error: "Please select a role" }), I'd prefer (or something like) role: (schema) => schema.role.notNull({ required_error: "Please select a role" }), Since then the valid values couldn't change. The above mismatch is removed if you refactor a little. export const roleTypes = ["USER", "ADMIN"] as const; // defined anywhere ... role: mysqlEnum("role", roleTypes).notNull(), // in createTable ... role: () => z.enum(roleTypes, { required_error: "Please select a role" }), // in createInsertSchema -zd
3 replies
TTCTheo's Typesafe Cult
Created by jjquek on 4/22/2023 in #questions
t3/next.js app - back button doesn't work?
Very interesting that you moved the context and it worked. Clerk was the one thing I didn't think to mess around with. But if they changed something on their side it'd explain it going from failed state to working without change locally. In the spirit of chirp 🤷‍♂️ 🐦🐤🦅🕊️🐣🤷‍♂️
8 replies
TTCTheo's Typesafe Cult
Created by jjquek on 4/22/2023 in #questions
t3/next.js app - back button doesn't work?
Bizarrely I came back to this today and it no longer has the issue. I double checked my vercel log to make sure I hadn't shipped an update in a sleepy state. Doesn't make much sense to me...
8 replies
TTCTheo's Typesafe Cult
Created by jjquek on 4/22/2023 in #questions
t3/next.js app - back button doesn't work?
Did you figure it out? I'm still stumped. I'm going ahead with my actual app. I just want to figure out the cause so I can avoid it.
8 replies
TTCTheo's Typesafe Cult
Created by jjquek on 4/22/2023 in #questions
t3/next.js app - back button doesn't work?
Same, the video is awesome, so I'm really glad it's there. That said, I experienced the same issue. I noticed https://xn--uo8h.t3.gg/ doesn't have this issue. I tried pulling down the final code from https://github.com/t3dotgg/chirp and putting my .env in it and I have the same issue (run local). I went back through my commits and reverted all the way back to essentially this commit https://github.com/t3dotgg/chirp/commit/402f66dd280f8c98fe548980ada4f92f203b7ca7 and as soon as I added the links it had the problem. I created a new t3 app locally and added a few pages with links back and forth. The back/forward buttons work fine on it. This really has me stumped at the moment. I also tried running build then start and have the same result. I likewise found the same old issue you found. One thing I just noticed. On user page if I click a post it goes there, then if I click the author it goes there. I can use back / forward browser buttons just fine between post/user pages. It's only when going to the index page where I have the browser button issue.
8 replies
TTCTheo's Typesafe Cult
Created by slavi_lns on 4/22/2023 in #questions
Amazon s3 alternative?
BackBlaze has been nice to us.
9 replies