Hey, is it a reasonable practice to have actions t...
# help
n
Hey, is it a reasonable practice to have actions that correspond to UI components, like for example "VIEW_EDIT_BUTTON"?
c
Yes, that's absolutely fine
r
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.
EDIT
- 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.
n
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
r
Got it! That makes sense.
Thanks for elaborating