Class: Services::AccountMappingsController

Inherits:
ThirdPartyBaseController show all
Defined in:
app/controllers/services/account_mappings_controller.rb

Constant Summary

Constants inherited from ApplicationController

Services::ApplicationController::MAX_LIST_LENGTH

Instance Attribute Summary collapse

Attributes inherited from ThirdPartyBaseController

#third_party

Instance Method Summary collapse

Instance Attribute Details

#account_mappingObject (readonly)

Returns the value of attribute account_mapping.



4
5
6
# File 'app/controllers/services/account_mappings_controller.rb', line 4

def 
  @account_mapping
end

Instance Method Details

#createObject



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

#destroyObject



36
37
38
39
# File 'app/controllers/services/account_mappings_controller.rb', line 36

def destroy
  .destroy
  render json: { id: .id }
end

#indexObject



10
11
12
# File 'app/controllers/services/account_mappings_controller.rb', line 10

def index
  @account_mappings = third_party.
end

#showObject



14
15
16
# File 'app/controllers/services/account_mappings_controller.rb', line 14

def show
  # Nothing to do
end

#updateObject



27
28
29
30
31
32
33
34
# File 'app/controllers/services/account_mappings_controller.rb', line 27

def update
  UpdateAccountMappingContext.call(, safe_params)
  if .errors.empty?
    render json: { id: .id }
  else
    render json: { validation_error: .errors.full_messages }, status: 403
  end
end