Skip to content

Commit

Permalink
Use provider policy when updating interview process
Browse files Browse the repository at this point in the history
  • Loading branch information
elceebee committed May 30, 2024
1 parent 0c574d3 commit 24f9756
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,19 @@ def update
private

def authorise_with_pundit
authorize provider
authorize course_to_authorise
end

def interview_process_params
params.require(:publish_course_interview_process_form).permit(*CourseInterviewProcessForm::FIELDS)
end

def course_to_authorise
@course_to_authorise ||= provider.courses.find_by!(course_code: params[:code])
end

def course
@course ||= CourseDecorator.new(provider.courses.find_by!(course_code: params[:code]))
@course ||= CourseDecorator.new(course_to_authorise)
end

def course_enrichment
Expand Down

0 comments on commit 24f9756

Please sign in to comment.