fix department can be apply added repeatedly bu

dev_sync_trustie
p31729568 5 years ago
parent a5657c2801
commit 8db7af8691

@ -14,6 +14,7 @@ class CreateAddDepartmentApplyService < ApplicationService
school = School.find_by(id: params[:school_id])
raise Error, '学校/单位不存在' if school.blank?
raise Error, '部门已存在' if school.departments.exists?(name: name)
department = Department.new
department.name = name

Loading…
Cancel
Save