Skip to content

Commit 997d004

Browse files
committed
fix masto api data merging
1 parent 90bb224 commit 997d004

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/api/graphql_masto_adapter.ex

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,23 @@ if Application.compile_env(:bonfire_api_graphql, :modularity) != :disabled do
117117
end)
118118
|> Map.new()
119119
)
120+
|> Enums.stringify_keys()
120121
)
121-
|> debug()
122+
|> debug("prepared activity for API")
122123
end
123124

124-
defp prepare_post(user) do
125-
# TODO: implement these fields
125+
defp prepare_post(post) do
126+
# TODO: add required fields
126127
%{
127128
# "locked"=> false,
128129
}
129130
|> Map.merge(
130-
user
131+
post
131132
|> Enums.maybe_flatten()
133+
|> Enums.stringify_keys()
132134
# |> Enums.map_put_default(:note, "") # because some clients don't accept nil
133135
)
134-
|> debug()
136+
|> debug("prepared post for API")
135137
end
136138
end
137139
end

0 commit comments

Comments
 (0)