class Cooperative::LaboratoryUsersController < Cooperative::BaseController def index laboratory_users = current_laboratory.laboratory_users @laboratory_users = paginate laboratory_users.includes(user: { user_extension: [:school, :department] }) end def create Admins::AddLaboratoryUserService.call(current_laboratory, params.permit(user_ids: [])) render_ok end def destroy current_laboratory_user.destroy! render_delete_success end private def current_laboratory_user @_current_laboratory_user ||= current_laboratory.laboratory_users.find(params[:id]) end end