Skip to content

Commit

Permalink
fix: resolve json on admin api
Browse files Browse the repository at this point in the history
  • Loading branch information
zoedsoupe committed May 17, 2024
1 parent 163d6b6 commit 234d3ee
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/supabase/go_true/admin_handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule Supabase.GoTrue.AdminHandler do
def sign_out(%Client{} = client, access_token, scope) do
endpoint = Client.retrieve_auth_url(client, sign_out(scope))
headers = Fetcher.apply_client_headers(client, access_token)
Fetcher.post(endpoint, nil, headers)
Fetcher.post(endpoint, nil, headers, resolve_json: true)
end

def invite_user(%Client{} = client, email, %InviteUserParams{} = opts) do
Expand All @@ -29,23 +29,23 @@ defmodule Supabase.GoTrue.AdminHandler do

client
|> Client.retrieve_auth_url(@invite)
|> Fetcher.post(body, headers)
|> Fetcher.post(body, headers, resolve_json: true)
end

def generate_link(%Client{} = client, %{type: _, redirect_to: redirect_to} = params) do
headers = Fetcher.apply_client_headers(client, nil, %{"redirect_to" => redirect_to})

client
|> Client.retrieve_auth_url(@generate_link)
|> Fetcher.post(params, headers)
|> Fetcher.post(params, headers, resolve_json: true)
end

def create_user(%Client{} = client, params) do
headers = Fetcher.apply_client_headers(client)

client
|> Client.retrieve_auth_url(@users)
|> Fetcher.post(params, headers)
|> Fetcher.post(params, headers, resolve_json: true)
end

def delete_user(%Client{} = client, id, params) do
Expand All @@ -55,7 +55,7 @@ defmodule Supabase.GoTrue.AdminHandler do

client
|> Client.retrieve_auth_url(uri)
|> Fetcher.delete(body, headers)
|> Fetcher.delete(body, headers, resolve_json: true)
end

def get_user(%Client{} = client, id) do
Expand All @@ -64,7 +64,7 @@ defmodule Supabase.GoTrue.AdminHandler do

client
|> Client.retrieve_auth_url(uri)
|> Fetcher.delete(nil, headers)
|> Fetcher.get(nil, headers, resolve_json: true)
end

def list_users(%Client{} = client, params) do
Expand Down Expand Up @@ -92,6 +92,6 @@ defmodule Supabase.GoTrue.AdminHandler do

client
|> Client.retrieve_auth_url(uri)
|> Fetcher.put(params, headers)
|> Fetcher.put(params, headers, resolve_json: true)
end
end

0 comments on commit 234d3ee

Please sign in to comment.