Class: Services::AccountMappingsController
Constant Summary
Services::ApplicationController::MAX_LIST_LENGTH
Instance Attribute Summary collapse
#third_party
Instance Method Summary
collapse
Instance Attribute Details
#account_mapping ⇒ Object
Returns the value of attribute account_mapping.
4
5
6
|
# File 'app/controllers/services/account_mappings_controller.rb', line 4
def account_mapping
@account_mapping
end
|
Instance Method Details
#create ⇒ Object
18
19
20
21
22
23
24
25
|
# File 'app/controllers/services/account_mappings_controller.rb', line 18
def create
am = CreateAccountMappingContext.call(third_party, safe_params)
if am.errors.empty?
render json: { id: am.id }
else
render json: { validation_error: am.errors.full_messages }, status: 403
end
end
|
#destroy ⇒ Object
36
37
38
39
|
# File 'app/controllers/services/account_mappings_controller.rb', line 36
def destroy
account_mapping.destroy
render json: { id: account_mapping.id }
end
|
#index ⇒ Object
10
11
12
|
# File 'app/controllers/services/account_mappings_controller.rb', line 10
def index
@account_mappings = third_party.account_mappings
end
|
#show ⇒ Object
14
15
16
|
# File 'app/controllers/services/account_mappings_controller.rb', line 14
def show
end
|
#update ⇒ Object
27
28
29
30
31
32
33
34
|
# File 'app/controllers/services/account_mappings_controller.rb', line 27
def update
UpdateAccountMappingContext.call(account_mapping, safe_params)
if account_mapping.errors.empty?
render json: { id: account_mapping.id }
else
render json: { validation_error: account_mapping.errors.full_messages }, status: 403
end
end
|