新增分班和新增讨论区子目录返回id

dev_ec^2
cxt 5 years ago
parent b0705de93f
commit c48ef87479

@ -20,9 +20,8 @@ class BoardsController < ApplicationController
new_board.parent_id = board.try(:id) new_board.parent_id = board.try(:id)
new_board.position = board.children.count + 1 new_board.position = board.children.count + 1
new_board.save! new_board.save!
render :json => {category_id: new_board.id, status: 0, message: "添加成功"}
end end
normal_status(0, "添加成功")
end end
# 子目录的拖动 # 子目录的拖动

@ -9,8 +9,8 @@ class CourseGroupsController < ApplicationController
if @course.course_groups.where(name: params[:name]).count > 0 if @course.course_groups.where(name: params[:name]).count > 0
normal_status(-1, "已存在同名分班") normal_status(-1, "已存在同名分班")
else else
@course.course_groups.create!(name: params[:name], position: @course.course_groups.count + 1) course_group = @course.course_groups.create!(name: params[:name], position: @course.course_groups.count + 1)
normal_status(0, "创建成功") render :json => {group_id: course_group.id, status: 0, message: "创建成功"}
end end
end end

Loading…
Cancel
Save