From 8abfbe2165ba727685d9348921b38743ba48ce2a Mon Sep 17 00:00:00 2001 From: Giteabot Date: Sat, 1 Apr 2023 21:15:46 -0400 Subject: [PATCH] Fix JS error when changing PR's target branch (#23862) (#23864) Backport #23862 by @wxiaoguang 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. Co-authored-by: wxiaoguang --- web_src/js/features/repo-issue.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index eb00157279..7265873b1b 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -647,8 +647,6 @@ export function initRepoIssueTitleEdit() { $.post(update_url, { _csrf: csrfToken, target_branch: targetBranch - }).done((data) => { - $branchTarget.text(data.base_branch); }).always(() => { window.location.reload(); });