My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

How do you handle slug-based routing, but translatable entities that have an empty slug at first? Which breaks..

Miguel Stevens's photo
Miguel Stevens
·Apr 15, 2019

I'm using slug-based routing, like this

myapp.com/posts/first-post

I have a Post entity, and a PostTranslation entity, When I create a Post entity, 2 PostTranslation entities are being created (for each language), and they have an empty slug and title field, so the user can choose this. The issue is that when I want to browse to this post, and the user didn't set a slug yet, it will break. How would you handle this?