Fix when creating a new org (#2375)

This commit is contained in:
Alexandre de Souza 2023-11-29 13:58:56 -03:00 committed by GitHub
parent d7e12fc9f9
commit 17ce53a144
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -190,8 +190,9 @@ defmodule Livebook.Teams.Requests do
defp post(path, json, team \\ nil) do
body = {"application/json", Jason.encode!(json)}
headers = if team, do: auth_headers(team), else: []
request(:post, path, body: body, headers: auth_headers(team))
request(:post, path, body: body, headers: headers)
|> dispatch_messages(team)
end
@ -240,7 +241,7 @@ defmodule Livebook.Teams.Requests do
end
end
defp dispatch_messages({:ok, %{"messages" => _} = body}, team) do
defp dispatch_messages({:ok, %{"messages" => _} = body}, %Livebook.Hubs.Team{} = team) do
{messages, body} = Map.pop!(body, "messages")
for message <- messages do