-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
If I understand correctly, preload_actions callback allows the user to specify which actions will be preloaded with resources but the preload_actions definition will include some default actions ([:show, :edit, :update, :delete, :index]) even if we pass one action, for example we want to preload only on :show action, so we should pass this action to preload_actions but it will append default actions to that making :show action duplicated ie. [:show, :show, :edit, :update, :delete, :index]
My suggestion is to return a list of preload actions provided by user and not include additional routes.
preload_actions callback definition:
permit_phoenix/lib/permit_phoenix/controller.ex
Lines 124 to 132 in 7a92b6f
| @impl true | |
| def preload_actions do | |
| preload_actions = unquote(opts_preload_actions) | |
| case preload_actions do | |
| nil -> [:show, :edit, :update, :delete, :index] | |
| list when is_list(list) -> list ++ [:show, :edit, :update, :delete, :index] | |
| end | |
| end |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels