0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-28 01:58:20 +01:00

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.
This commit is contained in:
wxiaoguang 2023-04-01 22:14:38 +08:00 committed by GitHub
parent aa9c920980
commit eadda68ded
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
});