replace [projectId] with project name

Currently my url looks like this: http://localhost:3000/projects/asdjkfb67284v. How can I replace ithe id "asdjkfb67284v" with a unique project name? For example, I want something like http://localhost:3000/projects/my-new-project.
5 Replies
Rhys
Rhys12mo ago
Hey this needs significantly more information in order to help you find a solution: - What framework are you using? - Do you control the ids or is it from another service? - Why do you need the ids to be more readable? - Why not just generate the id as the project name you want?
shikishikichangchang
NextJS (T3), I control, better user experience (breadcrumbs that use the url), havent thought about it (using cuid from prisma)
cje
cje12mo ago
Give your model a unique field for the name, base the slugs on that instead of id
razor
razor12mo ago
better to make slug the id in this case
shikishikichangchang
thanks guys
Want results from more Discord servers?
Add your server
More Posts
Linter & type check in nextjs apphi if all the linter & typecheck is already done in each PR branch with CI, do i still need to do Consumer tRPC client package from private API type?I have a monrepo (template from t3-turbo), with a tRPC API package. I'd like to expose a router for SKIP_ENV_VALIDATIONI have this set to 'true' in my .env but I'm still getting errors about missing envs (they aren't miHow to add unique username to user that signed in via provider?What I'm trying to do: I'm trying to force user to add username after they signed in via provider. ARecommended architecture for my simple web scraping data visualizer for gym capacityHello. As of now, I have set up a lambda function that runs every 15min (scheduled by AWS EventBridgIf I make a cross platform website/app with nextJS + react native, how does the backend work?i havent used nextJS before so its a gray area for me , will my react-native app share the same backwhat should i know about backend before starting with nextjs?I am learning react for a while, and I am felling pretty comfortable with building things with that Invalid Environment VariablesI am having an issue with accessing my ENVs within my drizzle.config.ts. I'm getting an error about I need help understanding request body typesHello 👋 I need help understanding how to tell typescript what type of value I expect `json` to beMoving primary content when sidebar appearsHi! I am not really sure what this would be called or considered, so my searching for something simi