分班邀请码的启用和停用

sso
cxt 5 years ago
parent 737fff1f11
commit ebeebf6e6e

@ -55,6 +55,12 @@ class CourseGroupsController < ApplicationController
end
end
# 邀请码停用/启用
def set_invite_code_halt
@group.update!(invite_code_halt: !@group.invite_code_halt)
normal_status(0, "成功")
end
private
def set_group

@ -662,6 +662,7 @@ Rails.application.routes.draw do
member do
post 'rename_group'
post 'move_category'
post 'set_invite_code_halt'
end
collection do

@ -0,0 +1,5 @@
class AddCodeHaltToCourseGroup < ActiveRecord::Migration[5.2]
def change
add_column :course_groups, :invite_code_halt, :boolean, default: false
end
end
Loading…
Cancel
Save