Skip to content

Commit

Permalink
https://github.com/bonfire-networks/bonfire-app/issues/916
Browse files Browse the repository at this point in the history
  • Loading branch information
mayel committed Apr 26, 2024
1 parent 47f86a4 commit 688d836
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/api/masto_adapter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ if Application.compile_env(:bonfire_api_graphql, :modularity) != :disabled do
action: [mode: :internal]

alias Bonfire.API.GraphQL.RestAdapter
alias Bonfire.Common.Enums

@user_profile "
id
id
created_at: date_created
profile {
avatar: icon
header: image
location
# location
display_name: name
note: summary
website
Expand All @@ -34,11 +35,7 @@ if Application.compile_env(:bonfire_api_graphql, :modularity) != :disabled do
def user(params, conn) do
user = graphql(conn, :user, debug(params))

RestAdapter.return(:user, user, conn, fn user ->
user
|> Map.drop([:profile, :character])
|> Map.merge(Map.merge(user[:profile] || %{}, user[:character] || %{}))
end)
RestAdapter.return(:user, user, conn, &Enums.maybe_flatten/1)
end

@graphql "query {
Expand Down

0 comments on commit 688d836

Please sign in to comment.