add: message touch condition

This commit is contained in:
2021-09-15 18:55:58 +08:00
parent fa0021b504
commit 88bc5f29ff
20 changed files with 362 additions and 100 deletions

View File

@@ -6,7 +6,8 @@ class Projects::ProjectUnitsController < Projects::BaseController
def create
if current_user.admin? || @project.manager?(current_user)
ActiveRecord::Base.transaction do
ProjectUnit.update_by_unit_types!(@project, unit_types)
before_units, after_units = ProjectUnit.update_by_unit_types!(@project, unit_types)
SendTemplateMessageJob.perform_later('ProjectSettingChanged', current_user.id, @project&.id, {navbar: true}) unless before_units.eql?(after_units)
render_ok
end
else