I’ve created an ‘article’ collection type with a text (title) and uid (slug) field. The uid field is attached to the title field so that every time I create an article using the Strapi admin panel, a slug gets generated. This works as expected and even adds a number if the slug already exists. Great feature!
However, generating the slug does not work when I make a POST request to the ‘articles’ endpoint. The POST request succeeds and a new article is added to the database, but the slug field remains empty. Manually adding a value to the slug field in the POST request works, but this seems redundant and also does not utilise the ‘uniqueness’ check. Is there something I’m missing here? Would love to know your ideas in getting this to work.
Any ideas or leads are greatly appreciated! Thanks
That’s because from Strapi Admin it makes a few extra requests to the /content-manager/explorer/uid/generate route to generate the slug and another request to the /content-manager/explorer/uid/check-availability to check if it’s available. You can take a look in your browser what data it exactly sends to them and use the same services