From 9c17275aaa7ea344517ab99bec176bc8cc5026ec Mon Sep 17 00:00:00 2001 From: SimonLab Date: Wed, 15 Apr 2020 16:29:08 +0100 Subject: [PATCH] return avatar information for user --- lib/app_api_web/auth_service_api.ex | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/app_api_web/auth_service_api.ex b/lib/app_api_web/auth_service_api.ex index 97422df..91a0725 100644 --- a/lib/app_api_web/auth_service_api.ex +++ b/lib/app_api_web/auth_service_api.ex @@ -27,7 +27,13 @@ defmodule AppApiWeb.AuthServiceApi do {:ok, %HTTPoison.Response{status_code: 200, body: body}} -> data = Poison.decode!(body) # get name from api - person = %{id_person: data["data"]["id_person"], name: "", email: data["data"]["email"]} + person = %{ + id_person: data["data"]["id_person"], + name: "", + email: data["data"]["email"], + avatar: ["data"]["avatar"] + } + {:ok, person} {:ok, %HTTPoison.Response{status_code: 404}} ->