lambert
TTCTheo's Typesafe Cult
•Created by lambert on 5/27/2023 in #questions
Search URL structuring
Hi guys, I have a dynamic URL in Next:
search/[word]/[[...rest]]
and I was wondering how would I parse this best?
I don't want to build the URL out directly, I want to keep it somewhat dynamic so I can do something like this: /search/Hello T3/tags/typescript|next/length/1-10
and structure it any way I like and leave stuff out I don't need.
My code currently is this, but I feel like this is super stupid:
2 replies
TTCTheo's Typesafe Cult
•Created by lambert on 3/14/2023 in #questions
TRPC & ReactQuery: How to check if logged in
Hi Guys,
how would you check if the current User is logged in?
I tried creating a Query which would return a Boolean, extract it into a Component and then conditionally render the Child or a NavitgateTo Component but that resulted in endless re-renders.
I don't have the Code right now but it was just a useQuery which would check for
isSuccess
and data.loggedIn
.
Thanks in advance!3 replies
TTCTheo's Typesafe Cult
•Created by lambert on 2/10/2023 in #questions
Turborepo & Prisma Environment Variables
Hi,
I'm currently setting up my Monorepo with Turborepo and env-vars are... weird.. with it.
The problem I'm currently having is, when I'm doing
npx prisma db push
in my apps/server
Folder, it complains about not finding the env file which Turborepo requires to have in the Root of the Workspace.
The current "solution" I have is a .env file in the root and the app, but I don't want to update my .env in two places.
Thanks in advance!2 replies