I defined the code interface for the search action as search_artists.
define :search_artists, action: :search, args: [:query]
- When calling this i get the error the function is not defined, but i can call it as search_artist, without the “s”.
Tunez.Music.search_artists(“fur”)
**** (UndefinedFunctionError) function Tunez.Music.search_artists/1 is undefined or private. Did you mean:**
** * search_artist/0**
** * search_artist/1**
** * search_artist/2**
** * search_artist!/0**
** * search_artist!/1**
** (tunez 0.1.0) Tunez.Music.search_artists(“fur”)**
** iex:23: (file)**
- When calling Tunez.Music.search_artist without an arg, the artists are listed, but when i pass in the query arg “fur” i get enumerable error:
Tunez.Music.search_artist(“fur”)
** (Protocol.UndefinedError) protocol Enumerable not implemented for type BitString
Got value:
"fur"
(elixir 1.18.2) lib/enum.ex:1: Enumerable.impl_for!/1
(elixir 1.18.2) lib/enum.ex:166: Enumerable.reduce/3
(elixir 1.18.2) lib/enum.ex:4511: Enum.reduce/3
(ash 3.4.71) lib/ash/resource/interface.ex:133: Ash.Resource.Interface.ReadOpts.validate!/1
(tunez 0.1.0) deps/ash/lib/ash/code_interface.ex:592: anonymous fn/1 in Tunez.Music.search_artist/2
(ash 3.4.71) lib/ash/code_interface.ex:277: anonymous fn/2 in Ash.CodeInterface.params_and_opts/3
(tunez 0.1.0) deps/ash/lib/ash/code_interface.ex:584: Tunez.Music.search_artist/2
iex:23: (file)