Hey, is it a reasonable practice to have actions t...
# help
Hey, is it a reasonable practice to have actions that correspond to UI components, like for example "VIEW_EDIT_BUTTON"?
Yes, that's absolutely fine
I'm curious as to why you'd make UI specific actions - can you elaborate your thoughts on that? I'm genuinely interested; I generally try to use verbs that make sense both server- and client side i.e.
- so that, if that user is allowed to edit an Article, for instance, you check for the "EDIT" action to determine if you should show the button; and also on the server side when the user attempts to update the article.
That's what I do for cases where there is a 1:1 mapping between the UI component and the server-side action, but I stumbled upon a case where 1 UI component allows the user to interact with N server-side actions, such that I had to either check for access to the N actions to conditionally render the component or have an action that corresponds to the display of the component itself
Got it! That makes sense.
Thanks for elaborating