Today we are going to build an API Endpoint to test if our blogpost slug is unqiue. We want it to return true if it is unique (indicating we can use it in our post), and false if we can not use it because the slug is already taken by another post.
In our Vue.js component we are going to refactor it so that only set the slug by using a setter method. THis allows us to only write our API call once, and validate it in our setter method. This simplifies the code significantly and makes it easier to maintain.
==== MORE FROM THIS SERIES . ====
Full Playlist for the "Building an Advanced Blog/CMS from Start to Finish" Series:
• Build Advanced Blog/ C...
==== DOWNLOAD SOURCE CODE ====
Download Code from this Episode:
github.com/Dev...
==== FOLLOW ME ====
Subscribe for New Releases!
Subscribe to DevMarketer Insider
confirmsubscri...
Twitter - / _jacurtis
(ask me questions!)
==== QUESTIONS? ====
Leave a comment below and I or someone else can help you.
For quick questions you may also want to ask me on Twitter, I respond almost immediately.
Email me hello@jacurtis.com
Thanks for all your support!
7 окт 2024