14 lines
377 B
14 lines
377 B
6 years ago
|
class Users::CoursesController < Users::BaseController
|
||
|
def index
|
||
|
courses = Users::CourseService.new(observed_user, query_params).call
|
||
|
|
||
|
@count = courses.count
|
||
|
@courses = paginate(courses.includes(teacher: { user_extension: :school }), special: true)
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
def query_params
|
||
|
params.permit(:category, :status, :sort_direction)
|
||
|
end
|
||
|
end
|