How to check if slug has spaces before the organization creation?
Hey all! I want to check if slug has spaces, if it has, return custom error so you can display error message on frontend "slug is invalid". I know about the beforeCreate and allowUserToCreateOrganization functions, but as far as I know, there is no way to return custom error message, to handle it on frontend.
7 Replies
Solution
why not just validate client side before submission to the API endpoint
or just slugify the users input (converting spaces to - or whatever)
i just tought there is a way and i dont need to create my own wrapper
I guess you could call the checkSlug function and return an error based on that
is it in auth client?
Yeah
Thank you brother!! ππΌππΌ