Skip to content

Commit 8abfbe2

Browse files
GiteaBotwxiaoguang
andauthored
Fix JS error when changing PR's target branch (go-gitea#23862) (go-gitea#23864)
Backport go-gitea#23862 by @wxiaoguang Caught by @justusbunsi An old bug from go-gitea#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. Co-authored-by: wxiaoguang <[email protected]>
1 parent 16bfe98 commit 8abfbe2

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

web_src/js/features/repo-issue.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,6 @@ export function initRepoIssueTitleEdit() {
647647
$.post(update_url, {
648648
_csrf: csrfToken,
649649
target_branch: targetBranch
650-
}).done((data) => {
651-
$branchTarget.text(data.base_branch);
652650
}).always(() => {
653651
window.location.reload();
654652
});

0 commit comments

Comments
 (0)