diff --git a/app/controllers/add_department_applies_controller.rb b/app/controllers/add_department_applies_controller.rb index 644ebd87e..9d2f1df01 100644 --- a/app/controllers/add_department_applies_controller.rb +++ b/app/controllers/add_department_applies_controller.rb @@ -2,8 +2,8 @@ class AddDepartmentAppliesController < ApplicationController before_action :require_login, :check_auth def create - CreateAddDepartmentApplyService.call(current_user, create_params) - render_ok + department = CreateAddDepartmentApplyService.call(current_user, create_params) + render_ok(id: department.id) rescue CreateAddDepartmentApplyService::Error => ex render_error(ex.message) end diff --git a/app/controllers/add_school_applies_controller.rb b/app/controllers/add_school_applies_controller.rb index c868d79c9..22b3d360a 100644 --- a/app/controllers/add_school_applies_controller.rb +++ b/app/controllers/add_school_applies_controller.rb @@ -2,8 +2,8 @@ class AddSchoolAppliesController < ApplicationController before_action :require_login, :check_auth def create - CreateAddSchoolApplyService.call(current_user, create_params) - render_ok + school = CreateAddSchoolApplyService.call(current_user, create_params) + render_ok(id: school.id) rescue CreateAddSchoolApplyService::Error => ex render_error(ex.message) end diff --git a/app/services/create_add_department_apply_service.rb b/app/services/create_add_department_apply_service.rb index f1d6cf852..8c3a2127e 100644 --- a/app/services/create_add_department_apply_service.rb +++ b/app/services/create_add_department_apply_service.rb @@ -38,6 +38,6 @@ class CreateAddDepartmentApplyService < ApplicationService message.save(validate: false) end - school + department end end