How to call actions on an embedded resource with code interface?
I've started working on my custom authentication in my app and the first step is to make a resource representing a logged in user. This resource is embedded cause I plan to only use it as an actor. I won't save it anywhere for now.
So as usual, I made some actions and a code interface for them, but I can't call them from IEx.
So how do I call them?
And while we're at it, how do I call a generic action normally outside a code interface?
Solution:Jump to solution
```elixir
code_interface do
domain YOur.Domain
define :create
define :from_token...
12 Replies
I spoke about this last in here https://discord.com/channels/711271361523351632/1253437793053577226/1387547657001631876
So as usual, I made some actions and a code interface for them, but I can't call them from IEx.Why can't you call them from
iex
?The functions don't get generated.
Ah, right
add
define_for YourDomain
into the code interface blockThis one is short enough that I can share it
For embedded resources, we don't know what domain's rules to use when defining those functions, you have to use
define_for
for the functions to be definedI can't put it in my domain cause it's embedded, but I'm not sure if that's related here
But there is no function define_for
Sorry, that may be the old name for it
Solution
Ah that did it thanks