Ash FrameworkAF
Ash Framework3y ago
5 replies
dungnguyen8134

code_interface not expose function

Hi guys,
I have a resource like this:
defmodule OrangeCms.Content.ContentType do
  use Ash.Resource,
    data_layer: AshPostgres.DataLayer

  ...
 code_interface do
    define_for(OrangeCms.Content)

    define(:open, action: :create, args: [:subject])
  end
  ...
end


But when I tried calling open, I got this error
iex(1)> OrangeCms.Content.open(%{subject: "hello"})
** (UndefinedFunctionError) function OrangeCms.Content.open/1 is undefined or private
    (orange_cms 0.1.0) OrangeCms.Content.open(%{subject: "hello"})


Did I do anything wrong with the code?
Was this page helpful?