MiguelStevens
5 months ago

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

Posted 5 months ago by MiguelStevens

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?

Please sign in or create an account to participate in this conversation.