Skip to content

Commit eadda68

Browse files
authored
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.
1 parent aa9c920 commit eadda68

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

web_src/js/features/repo-issue.js

-2
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,6 @@ export function initRepoIssueTitleEdit() {
645645
$.post(update_url, {
646646
_csrf: csrfToken,
647647
target_branch: targetBranch
648-
}).done((data) => {
649-
$branchTarget.text(data.base_branch);
650648
}).always(() => {
651649
window.location.reload();
652650
});

0 commit comments

Comments
 (0)