fix(web): prefer form redirect and soft-default now_if_empty
Desk 文案 cancel links stamp redirect so POST leaves the compose page; empty date fields can opt into 空则现在 without blocking custom values. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
3f96592c99
commit
4b7643d833
5 files changed
+56
-9
No files matched your search
@@ -504,8 +504,10 @@ func (st *state) handleFormPost(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if ok, _ := res["ok"].(bool); ok {
|
||||
// Prefer an explicit form redirect (e.g. cancel_href list URL) over the
|
||||
// composing page path stamped as _mq_return.
|
||||
redir := strOpt(res, "redirect", "/")
|
||||
if ctx.ReturnPath != "" {
|
||||
if (redir == "" || redir == "/") && ctx.ReturnPath != "" {
|
||||
redir = ctx.ReturnPath
|
||||
}
|
||||
http.Redirect(w, r, redir, http.StatusSeeOther)
|
||||
|
||||
Reference in new issue
Block a user