generated from DFE-Digital/govuk-rails-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move qualifications API into v1 namespace
- Loading branch information
Showing
5 changed files
with
37 additions
and
33 deletions.
There are no files selected for viewing
29 changes: 0 additions & 29 deletions
29
app/controllers/api/teacher_record_service/qualifications_controller.rb
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
app/controllers/api/teacher_record_service/v1/qualifications_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
module API | ||
module TeacherRecordService | ||
module V1 | ||
class QualificationsController < BaseController | ||
def show | ||
participant_outcomes = participant_outcome_query | ||
|
||
render json: to_json(participant_outcomes) | ||
end | ||
|
||
private | ||
|
||
def trn | ||
params[:trn] | ||
end | ||
|
||
def participant_outcome_query | ||
Qualifications::Query.new.qualifications(trn:) | ||
end | ||
|
||
def to_json(participant_outcomes) | ||
QualificationsSerializer.render(trn, root: "data", participant_outcomes:) | ||
end | ||
|
||
def api_token_scope | ||
APIToken.scopes[:teacher_record_service] | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
spec/requests/api/teacher_record_service/qualifications_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters