mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-01-01 12:41:43 +08:00
Fix when creating a new org (#2375)
This commit is contained in:
parent
d7e12fc9f9
commit
17ce53a144
1 changed files with 3 additions and 2 deletions
|
@ -190,8 +190,9 @@ defmodule Livebook.Teams.Requests do
|
||||||
|
|
||||||
defp post(path, json, team \\ nil) do
|
defp post(path, json, team \\ nil) do
|
||||||
body = {"application/json", Jason.encode!(json)}
|
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)
|
|> dispatch_messages(team)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -240,7 +241,7 @@ defmodule Livebook.Teams.Requests do
|
||||||
end
|
end
|
||||||
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")
|
{messages, body} = Map.pop!(body, "messages")
|
||||||
|
|
||||||
for message <- messages do
|
for message <- messages do
|
||||||
|
|
Loading…
Reference in a new issue