diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-04-01 22:14:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-01 22:14:38 +0800 |
commit | eadda68ded10fe65a6351198b47163eba9762d7a (patch) | |
tree | d53c1724f9ecdd0d6118e2e0e2e761dd19d43042 /web_src/js/features | |
parent | aa9c9209800e07127065ad296a9d1d4af883ae36 (diff) | |
download | gitea-eadda68ded10fe65a6351198b47163eba9762d7a.tar.gz gitea-eadda68ded10fe65a6351198b47163eba9762d7a.zip |
Fix JS error when changing PR's target branch (#23862)
Caught by @justusbunsi
An old bug from #6488
In `pullrequest_targetbranch_change`, the `data` might be empty, because
`UpdatePullRequestTarget` may respond `http.StatusNoContent`.
And the old code's `$branchTarget.text(data.base_branch);` doesn't make
sense, because in the end, the page will be always reloaded.
So, just remove the `$branchTarget.text(data.base_branch);`, everything
should be fine.
Diffstat (limited to 'web_src/js/features')
-rw-r--r-- | web_src/js/features/repo-issue.js | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index f1425d4459..3f1b73d91e 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -645,8 +645,6 @@ export function initRepoIssueTitleEdit() { $.post(update_url, { _csrf: csrfToken, target_branch: targetBranch - }).done((data) => { - $branchTarget.text(data.base_branch); }).always(() => { window.location.reload(); }); |