You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
616 B
22 lines
616 B
6 years ago
|
class Ecs::StudentsController < Ecs::BaseController
|
||
|
before_action :check_major_manager_permission!, only: [:destroy, :import]
|
||
|
|
||
|
def show
|
||
|
students = current_year.ec_year_students
|
||
|
|
||
|
@count = students.count
|
||
|
@students = paginate students
|
||
|
end
|
||
|
|
||
|
def destroy
|
||
|
current_year.ec_year_students.where(id: params[:ids]).destroy_all
|
||
|
render_ok
|
||
|
end
|
||
|
|
||
|
def import
|
||
|
success_count = Ecs::ImportStudentService.call(current_year, params[:attachment_id])
|
||
|
render_ok(success_count: success_count)
|
||
|
rescue Ecs::ImportStudentService::Error => ex
|
||
|
render_error(ex.message)
|
||
|
end
|
||
|
end
|