Making a simple dictionary

i have added DictionaryTitle and Dictionary on the schema and im lost T^T .... i want to connect them so when i click the title it should go in to a new page for the definition of that title is
No description
No description
No description
No description
No description
5 Replies
rphlmr ⚡
rphlmr ⚡2mo ago
You need a page that expects a titleId as param (https://nextjs.org/docs/pages/building-your-application/routing/dynamic-routes). On click from your card, redirect to /somewhere/${titleId} From there, you can now query the dictionary table:
const definition = db.query.dictionary.findFirst({where: eq(dictionary.titleId, titleId)})
const definition = db.query.dictionary.findFirst({where: eq(dictionary.titleId, titleId)})
Slime
SlimeOP2mo ago
thank you for replying good sir .. sorry, this is my first time using drizzle kit T^T ... may i know which page should i put the titleId param how to set it up? is it on dictionary-title or on the dictionary ... im done reading the docs and im still confused T^T... im planning on using the dictionary for the discripting on the title
No description
rphlmr ⚡
rphlmr ⚡2mo ago
Routing: Dynamic Routes | Next.js
Dynamic Routes can be used to programmatically generate route segments from dynamic data.
rphlmr ⚡
rphlmr ⚡2mo ago
I am not a nextjs expert but maybe a app/(main)/dictionary/[title-id]/page.tsx.
Slime
SlimeOP2mo ago
i didnt do this since i dont want to get my code to be more complicated instead i created card and title ... anything to fix ???
No description
No description
No description
Want results from more Discord servers?
Add your server