Class: Services::ConfiguredAccountsController
Constant Summary
ApplicationController::MAX_LIST_LENGTH
Instance Attribute Summary collapse
#parent, #service_definition
Instance Method Summary
collapse
Instance Attribute Details
Returns the value of attribute configured_account.
4
5
6
|
# File 'app/controllers/services/configured_accounts_controller.rb', line 4
def configured_account
@configured_account
end
|
Instance Method Details
#create ⇒ Object
18
19
20
21
22
23
24
25
|
# File 'app/controllers/services/configured_accounts_controller.rb', line 18
def create
ca = CreateConfiguredAccountContext.call(service_definition, safe_ca_params, safe_cred_params)
if ca.errors.empty?
render json: { id: ca.id }
else
render json: { validation_error: ca.errors.full_messages }, status: 403
end
end
|
#destroy ⇒ Object
36
37
38
39
|
# File 'app/controllers/services/configured_accounts_controller.rb', line 36
def destroy
configured_account.destroy
render json: { id: configured_account.id }
end
|
#index ⇒ Object
10
11
12
|
# File 'app/controllers/services/configured_accounts_controller.rb', line 10
def index
@configured_accounts = service_definition.configured_accounts.includes(:credentials)
end
|
#show ⇒ Object
14
15
16
|
# File 'app/controllers/services/configured_accounts_controller.rb', line 14
def show
end
|
#update ⇒ Object
27
28
29
30
31
32
33
34
|
# File 'app/controllers/services/configured_accounts_controller.rb', line 27
def update
UpdateConfiguredAccountContext.call(configured_account, safe_ca_params, safe_cred_params)
if configured_account.errors.empty?
render json: { id: configured_account.id }
else
render json: { validation_error: configured_account.errors.full_messages }, status: 403
end
end
|