Folks,
I have a little doubt …
I’m trying to get my controller to list the content only what is his.
I got the id of the current session, and put it in my “where” to list.
But I get the following error.
Error
value
2
inwhere
cannot be cast to type :string in query:
controller
def index(conn, params) do
indicacoes = Dashboards.list_indicacoes()
sessao_atual = conn.assigns.current_user.id
page = Indicacao
|> where([a], a.dev_id == ^sessao_atual)
|> order_by(desc: :updated_at)
|> Repo.paginate(params)
render(conn, "index.html", indicacoes: indicacoes, indicacoes: page.entries, page: page)
end
Someone would know how to help me, how would it look?