Class: Vkit::CLI::Commands::RequestsListCommand

Inherits:
BaseCommand
  • Object
show all
Defined in:
lib/vkit/cli/commands/requests_list_command.rb

Instance Method Summary collapse

Instance Method Details

#call(state:, format:) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/vkit/cli/commands/requests_list_command.rb', line 10

def call(state:, format:)
  with_auth do
    user = credential_store.user
    org  = user["organization_slug"]

    params = {}
    params[:state] = state unless state == "all"

    response = authenticated_client.get(
      "/api/v1/orgs/#{org}/requests",
      params: params
    )

    render(response, format)
  end
end