Hey, is it a reasonable practice to have actions that correspond to UI components, like for example "VIEW_EDIT_BUTTON"?
06/22/2023, 5:26 PM
Yes, that's absolutely fine
06/22/2023, 5:55 PM
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.
06/22/2023, 6:04 PM
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