Skip to content

Commit 6f3308b

Browse files
committed
working
1 parent ee28d2f commit 6f3308b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

web_src/js/features/repo-settings-branches.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {createSortable} from '../modules/sortable.ts';
22
import {POST} from '../modules/fetch.ts';
33
import {showErrorToast} from '../modules/toast.ts';
4+
import {queryElemChildren} from '../utils/dom.ts';
45

56
export function initRepoBranchesSettings() {
67
const protectedBranchesList = document.querySelector('#protected-branches-list');
@@ -12,10 +13,8 @@ export function initRepoBranchesSettings() {
1213

1314
onEnd: () => {
1415
(async () => {
15-
const itemIds = Array.from(protectedBranchesList.children, (item) => {
16-
const id = item.getAttribute('data-id');
17-
return parseInt(id);
18-
});
16+
const itemElems = queryElemChildren(protectedBranchesList, '.item[data-id]');
17+
const itemIds = Array.from(itemElems, (el) => el.getAttribute('data-id'));
1918

2019
try {
2120
await POST(protectedBranchesList.getAttribute('data-update-priority-url'), {

0 commit comments

Comments
 (0)