Class: Api::V2::SubmissionsController

Inherits:
JSONAPI::ResourceController
  • Object
show all
Defined in:
app/controllers/api/v2/submissions_controller.rb

Overview

Provides a JSON API controller for submission See: jsonapi-resources.com/ for JSONAPI::Resource documentation

Instance Method Summary collapse

Instance Method Details

#paramsObject

JSONAPI-Resource doesn't currently allow for non-default fields See github.com/cerebris/jsonapi-resources/issues/855 This is a temporary override, although probably won't help if submission is included in a different resource


15
16
17
18
19
20
21
22
# File 'app/controllers/api/v2/submissions_controller.rb', line 15

def params
  default = super
  return default if default.dig('fields', 'submissions')

  default['fields'] ||= {}
  default['fields']['submissions'] = 'uuid,name'
  default
end