Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mydearxym authored Dec 5, 2017
1 parent fafe96a commit 0011683
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/blog_web/resolvers/accounts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ defmodule BlogWeb.Resolvers.Accounts do
{:ok, user}
end
end

def find_user(%{author_id: author_id}, _args, _resolution) do
case Blog.Accounts.find_user(author_id) do
nil ->
{:error, "User ID not found"}
user ->
{:ok, user}
end
end


def create_user(_parent, args, %{context: %{current_user: %{admin: true}}}) do
Blog.Accounts.create_user(args)
Expand Down

0 comments on commit 0011683

Please sign in to comment.