Jazon
Explore posts from serversTTCTheo's Typesafe Cult
•Created by Viszy A on 11/15/2023 in #questions
How do I actually use tRPC without using a server component
You are trying to use the api endpoint from the server in
import { api } from "@/trpc/server";
In order to use the trpc api from your client components, you would need to use import { api } from "~/trpc/react";
. Or of course use a @
if that's your alias. The api is exported from the trpc
folder, not the server folder. In a file called react.tsx
4 replies
TTCTheo's Typesafe Cult
•Created by Jazon on 10/14/2023 in #questions
How do I query self-relations?
Worked now with this schema
Maybe my client didnt get regenerated properly before when changing the schema. I guess I cold just go with this implicitly. As of right now, I don't think I'll need any other fields for the following/follower stuff.
12 replies
TTCTheo's Typesafe Cult
•Created by Jazon on 10/14/2023 in #questions
How do I query self-relations?
That was my initial thought too. And I hope you're right. But then I don't know why the heck they would do it that way too in the docs? Not quite familiar with SQL relations. https://www.prisma.io/docs/concepts/components/prisma-schema/relations/self-relations
But I still can't include the followers or the following with your schema
12 replies
TTCTheo's Typesafe Cult
•Created by Jazon on 9/13/2023 in #questions
Next Auth middleware redirects me to the login page, even if there's a session
Well right now the regular exported function with the withAuth stuff. Also have matcher. But if I remove the matcher, then I can't (of course) visit any page.
4 replies
TTCTheo's Typesafe Cult
•Created by Jazon on 4/23/2023 in #questions
Handle many-to-many relations in Prisma with MySQL
Ohh okay, cool! Any explanation to why it works like this? Why do you need relation when it's not many-to-many and vice versa?
9 replies
TTCTheo's Typesafe Cult
•Created by fjzon on 4/14/2023 in #questions
Create a User model in Prisma with Clerk on Signup
Realized that I will also need to use webhooks for something similar. I got a request too work if I put a webhook.js file in nextjs/pages/api-folder. However, if I put it in like expo/src/api, it doesn't work. I assume I will have to run the tunnel (localTunnel) from the expo folder. And run it on port 19000, since that's what it looks like expo is running from.
57 replies
TTCTheo's Typesafe Cult
•Created by Jazon on 4/12/2023 in #questions
Is it safe to get all data based on a route query parameter?
Alright cool, thanks!
7 replies
TTCTheo's Typesafe Cult
•Created by Jazon on 4/12/2023 in #questions
Is it safe to get all data based on a route query parameter?
@Brendonovich The getAll-procedure looks like this
But isn't the protectedProcedure only there to check that the user isn't an unauthenticated user? That the "ctx" in this case is what is being bound to the session and the only one to check if the user really is the current signed in one?
7 replies