Hi:
I’m new to Phoenix and currently having below issue:
I’m trying to create a plug to hook to one of my controllers, but no matter in which way I try to build an Ecto query, responds back with the same error: expected a keyword list in `where`, got: `[{"uid", "my_uid"}]`
This is the extract of the code in my plug:
def call(conn, repo) do
user = if ["dashboard", uid] = conn.path_info do
repo.one(from u in User, where: u.uid == ^uid) #attempt 1
repo.get_by!(User, %{uid: uid}) #attempt 2
repo.get_by!(User, uid: uid) #attempt 3
end
assign(conn, :current_user, user)
end
And I’m not even sure which of the lines would actually be able to trigger the error. Can you please show the full code and the full error message that triggers the error message? Please do not obfuscate anything and show the code as it generates the message.