Generic action has `api` nil in context when called from `code_interface`
I have a generic action in my resource:
and I have it set in that resource
code_interface
:
Since I have the define_for
in the code_interface
I was expecting that the generic action context will have the api
key filled with FeedbackCupcake.Accounts
so I can fetch it and use in to call read
function.
Is this a bug? If not, how can I figure out what is the API I should call that function in this case?4 Replies
Hmm…I’d have to look. Does it have the api in the context when you call it outside of the code interface?
Might just be a missing feature 🙂
And one that shouldn’t be too difficult to add
I will check that ASAP and return with an update
I belive that is the correct way to run a generic action right?
If so, the api field in the context is still
nil
Gotcha. I think what we should do is add an
api
field to ActionInput
And set that field when you call run_action
Should be a pretty small change. You want to take a stab at it?Sure, I will try it out today in the evening
Hey @Zach Daniel , took me some time to go back to this, but FYI I just created a small PR which fills the api field from ActionInput when running an action.
https://github.com/ash-project/ash/pull/676