theFern
Explore posts from serversTTCTheo's Typesafe Cult
•Created by AdmiralGeneralAladeen on 10/30/2022 in #questions
How do you push schema changes to a dev branch with planetscale and prisma
You're right, I just don't know how to push the change to the development branch instead 😅
7 replies
TTCTheo's Typesafe Cult
•Created by AdmiralGeneralAladeen on 10/30/2022 in #questions
How do you push schema changes to a dev branch with planetscale and prisma
7 replies
TTCTheo's Typesafe Cult
•Created by theFern on 12/12/2022 in #questions
Is there a way on NextAuth to redirect upon login to a specific page based on session role?
@lukacolic Yes, I think you're totally right. I thought there would be a more direct way of doing from NextAuth but re-directing from main page seems like the most logical.
@deforestor Thanks! This seems like a pretty good approach although I would probably would not use useEffect. Perhaps something more like what Theo explains in this video: https://youtu.be/h6wBYWWdyYQ?t=618
9 replies
TTCTheo's Typesafe Cult
•Created by theFern on 12/12/2022 in #questions
Is there a way on NextAuth to redirect upon login to a specific page based on session role?
Or if there are other ways of doing this without NextAuth, I'm open to any solution as well...
9 replies
TTCTheo's Typesafe Cult
•Created by Johnson on 12/12/2022 in #questions
nextAuth working only locally (not on vercel deployment)
Can you provide a screenshot of your Vercel logs?
158 replies
TTCTheo's Typesafe Cult
•Created by theFern on 12/7/2022 in #questions
Deployment Errors on Vercel related to Tanstack NPM Packages
@lukacolic So it seems the dependency that was causing the issue was react-query dev tools. I uninstalled the library and that solved the issue. Not sure if there's a way around this, otherwise I'll just have to uninstall it every time I want to deploy which is obviously not a good solution.
I'll give your last solution a try next time I deploy. Thanks!
12 replies
TTCTheo's Typesafe Cult
•Created by theFern on 12/7/2022 in #questions
Deployment Errors on Vercel related to Tanstack NPM Packages
thanks so much for the insight guys!
12 replies
TTCTheo's Typesafe Cult
•Created by theFern on 12/7/2022 in #questions
Deployment Errors on Vercel related to Tanstack NPM Packages
12 replies
TTCTheo's Typesafe Cult
•Created by theFern on 11/30/2022 in #questions
Any recommendations for a date library?
Thanks but I'm going to be working with dates and times quite extensively on my app so I'd rather use a library
6 replies
TTCTheo's Typesafe Cult
•Created by theFern on 11/30/2022 in #questions
Any recommendations for a date library?
Thanks, I'll check it out
6 replies
TTCTheo's Typesafe Cult
•Created by theFern on 11/25/2022 in #questions
Type error with tRPC, Zod, Prisma
Amazing.. thanks so much guys!
7 replies
TTCTheo's Typesafe Cult
•Created by theFern on 11/23/2022 in #questions
Does anyone have any examples on how to declare global user context from database with t3 stack?
Thanks so much! I'll take a look
8 replies
TTCTheo's Typesafe Cult
•Created by theFern on 11/23/2022 in #questions
Does anyone have any examples on how to declare global user context from database with t3 stack?
Should this be done with a protectedProcedure using tRPC middleware? If so, any examples using Prisma?
8 replies
TTCTheo's Typesafe Cult
•Created by theFern on 11/16/2022 in #questions
tRPC, query invalidation is not working
13 replies
TTCTheo's Typesafe Cult
•Created by theFern on 11/16/2022 in #questions
tRPC, query invalidation is not working
13 replies
TTCTheo's Typesafe Cult
•Created by theFern on 11/16/2022 in #questions
tRPC, query invalidation is not working
Yes, still doesn't work :/
const utils = trpc.useContext()
const students = trpc.student.getAll.useQuery()
const addStudentTRPC = trpc.student.add.useMutation({
onSuccess() {
utils.student.getAll.invalidate()
},
})
const handleAddStudent = async (values: any) => {
await addStudentTRPC.mutate({
studentFirstName: values.studentFirstName,
studentLastName: values.studentLastName,
studentDateOfBirth: values.studentDateOfBirth,
userId: values.teacher,
})
}
13 replies
TTCTheo's Typesafe Cult
•Created by currenthandle on 11/12/2022 in #questions
List In UI Not Showing New Data Until Refreshed tRPC React-Query
const utils = trpc.useContext()
const students = trpc.student.getAll.useQuery()
const addStudentTRPC = trpc.student.add.useMutation({
onSuccess() {
utils.student.getAll.invalidate()
},
})
This invalidation is currently not working for me10 replies
TTCTheo's Typesafe Cult
•Created by currenthandle on 11/12/2022 in #questions
List In UI Not Showing New Data Until Refreshed tRPC React-Query
Do you mind showing how you did this in your code? I'm having trouble invalidating or refetching queries upon successful mutation as well
10 replies