.traevelliath
.traevelliath
Explore posts from servers
TtRPC
Created by Thimo_o on 8/26/2023 in #❓-help
How do I setup App router + TRPC + Lucia Auth? (protected routes)
Why? Look how protected procedures were implemented by Theo, for example, in his Chirp guide. And do the same.
7 replies
TtRPC
Created by Thimo_o on 8/26/2023 in #❓-help
How do I setup App router + TRPC + Lucia Auth? (protected routes)
7 replies
TTCTheo's Typesafe Cult
Created by .traevelliath on 7/31/2023 in #questions
Prisma enum causes maximum call stack size exceeded.
Okay, It was fixed in 5.1.0, apparently.
4 replies
TTCTheo's Typesafe Cult
Created by Mj on 7/31/2023 in #questions
Help me not to give up on t3.
Why would you manually set data to cache? In your place, I would have waited until mutation is successful, then: await utils.posts.getAll.invalidate()
4 replies
TTCTheo's Typesafe Cult
Created by digeman on 7/31/2023 in #questions
Setting up and testing endpoints (for t3 stack)
it's achieved through webhooks. This 'another website' should send one to the endpoint you expose spicifically for this, then based on payload or type of event you can execute logic.
5 replies
TTCTheo's Typesafe Cult
Created by RevengeTime on 7/31/2023 in #questions
Prisma or Trpc for fetching data?
powerful trpc middleware.
2 replies
TTCTheo's Typesafe Cult
Created by .traevelliath on 7/31/2023 in #questions
Prisma enum causes maximum call stack size exceeded.
If you want to try for yourself:
4 replies
TTCTheo's Typesafe Cult
Created by .traevelliath on 7/7/2023 in #questions
Update userId which is used for defining relationships between models
I had to define onUpdate only on self-relations (teacher-students and student-teacher). So when I try to change first the id of the teacher then look for an old id in teacherId records, prisma throws an error saying that I violate self-relation.
4 replies
TtRPC
Created by toadmilk on 7/4/2023 in #❓-help
problem with useContext (likely easy fix)
It's actually pretty simple to fix: just move trpcUtils declaration outside of a function. You should probalby get the desired data inside a component and pass it as a prop.
3 replies
TTCTheo's Typesafe Cult
Created by zendev on 6/29/2023 in #questions
tRPC query gets the type right on the way in and wrong on the way out?
Not really. I think your way is okay, but as far as I can tell, isArtist and artistName both must be truthy for an artist in your app. So why have isArtist, when you can check for whether a user has artistName right away and thus, may be, get rid of this undefined issue?
6 replies
TTCTheo's Typesafe Cult
Created by zendev on 6/29/2023 in #questions
tRPC query gets the type right on the way in and wrong on the way out?
Why have 2 properties when you can have just artistName and check if the user has it, then filter them according to this check. This way, probably, you won't run into undefined.
6 replies
TTCTheo's Typesafe Cult
Created by dondonai on 6/29/2023 in #questions
React Query cache is not working?
What exactly is the issue? Cache is working, but you are manually requesting a refetch, so the data gets repopulated.
3 replies
TtRPC
Created by schlabach on 6/23/2023 in #❓-help
Prefetch on useContext() is not being picked up by react-query.
6 replies
TTCTheo's Typesafe Cult
Created by rasib on 6/29/2023 in #questions
Why does the official Twitter website look so different on mobile?
>Also, do you think they use state hook for the " ... " Collapsing of names and @handles? I think they use 3 simple css rules: { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
4 replies
TtRPC
Created by schlabach on 6/23/2023 in #❓-help
Prefetch on useContext() is not being picked up by react-query.
Isn’t the point of prefetch to be called inside getServerSideProps? Then you can get the data from the client by using getData().
6 replies
TTCTheo's Typesafe Cult
Created by zendev on 6/28/2023 in #questions
Clerk - can’t get types of unsafeMetadata properties on user object?
Yeah, I mean when you set it in clerk dashboard, clerk has a hint on what type of data you gave it. But clerkClient, when you fetch from server, cannot not know if the data in custom metadata on a specific user on which it has nothing yet even exist. So yeah, manual assertion is the way I guess.
5 replies
TTCTheo's Typesafe Cult
Created by lecookie on 6/28/2023 in #questions
Admin dashboard
6 replies
TTCTheo's Typesafe Cult
Created by lecookie on 6/28/2023 in #questions
Admin dashboard
Definitely roles do need to be involved. Once you set them up, you can use getServerSideProps to redirect ( return {redirect: ... } ) or throw 403.
6 replies
TTCTheo's Typesafe Cult
Created by zendev on 6/28/2023 in #questions
Clerk - can’t get types of unsafeMetadata properties on user object?
AFAIK, clerk does not and cannot know, what type of custom metadata it would be. So you have to assert them manually with overloading or 'as string'.
5 replies
TTCTheo's Typesafe Cult
Created by .traevelliath on 6/22/2023 in #questions
Prisma 2-3 levels deep queries
tried all combinations of the above, same result. Guess I am to resort to .map()
17 replies