Merge pull request '新增关闭站点时必须填写理由' (#245) from KingChan/forgeplus:chenjing into standalone_develop

This commit is contained in:
KingChan 2024-01-10 10:23:30 +08:00
commit 515bf4663d
1 changed files with 6 additions and 2 deletions

View File

@ -29,8 +29,12 @@ class Admins::SitePagesController < Admins::BaseController
end end
def update def update
@site_page.update(update_params) if update_params[:state] == "false" && update_params[:state_description].blank?
flash[:success] = '保存成功' flash[:danger] = '关闭站点理由不能为空'
else
@site_page.update(update_params)
flash[:success] = '保存成功'
end
render 'edit' render 'edit'
end end