add id response to add school and add department

dev_forum
p31729568 5 years ago
parent 9e331cba6d
commit 6c4e959630

@ -2,8 +2,8 @@ class AddDepartmentAppliesController < ApplicationController
before_action :require_login, :check_auth before_action :require_login, :check_auth
def create def create
CreateAddDepartmentApplyService.call(current_user, create_params) department = CreateAddDepartmentApplyService.call(current_user, create_params)
render_ok render_ok(id: department.id)
rescue CreateAddDepartmentApplyService::Error => ex rescue CreateAddDepartmentApplyService::Error => ex
render_error(ex.message) render_error(ex.message)
end end

@ -2,8 +2,8 @@ class AddSchoolAppliesController < ApplicationController
before_action :require_login, :check_auth before_action :require_login, :check_auth
def create def create
CreateAddSchoolApplyService.call(current_user, create_params) school = CreateAddSchoolApplyService.call(current_user, create_params)
render_ok render_ok(id: school.id)
rescue CreateAddSchoolApplyService::Error => ex rescue CreateAddSchoolApplyService::Error => ex
render_error(ex.message) render_error(ex.message)
end end

@ -38,6 +38,6 @@ class CreateAddDepartmentApplyService < ApplicationService
message.save(validate: false) message.save(validate: false)
end end
school department
end end
end end

Loading…
Cancel
Save