Skip to content

Commit

Permalink
Fix FinancialInstitution.find_public/1
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Zitter committed Sep 25, 2024
1 parent 23ef4a7 commit faf8ea2
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions lib/ibanity/api/ponto_connect/financial_institution.ex
Original file line number Diff line number Diff line change
Expand Up @@ -191,23 +191,12 @@ defmodule Ibanity.PontoConnect.FinancialInstitution do
time_zone: nil
}}
"""
def find_public(%Request{token: token} = request_or_token, id) when not is_nil(token) do
request_or_token
def find_public(%Request{} = request \\ %Request{}, id) do
request
|> Request.id(id)
|> Client.execute(:get, @api_schema_path, __MODULE__)
end

def find_public(%PontoConnect.Token{} = request_or_token, id) do
request_or_token
|> Request.token()
|> find_public(id)
end

def find_public(other, _id) do
raise ArgumentError,
message: PontoConnect.Exceptions.token_argument_error_msg("FinancialInstitution", other)
end

@doc """
[Find organization's financial institution by id](https://documentation.ibanity.com/ponto-connect/2/api#get-organization-financial-institution)
Expand Down

0 comments on commit faf8ea2

Please sign in to comment.