0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-25 07:22:51 +01:00

fix webui lint issues

This commit is contained in:
6543 2024-10-21 21:45:27 +02:00
parent 5056af5fac
commit b939a8d32a

View file

@ -2,17 +2,19 @@ import {createSortable} from '../modules/sortable.ts';
import {POST} from '../modules/fetch.ts';
export function initRepoBranchesSettings() {
const protectedBranchesList = document.querySelector('#protected-branches-list');
const protectedBranchesList = document.querySelector(
'#protected-branches-list',
);
if (!protectedBranchesList) return;
createSortable(protectedBranchesList, {
handle: '.drag-handle',
animation: 150,
onEnd: async (e) => { // eslint-disable-line @typescript-eslint/no-misused-promises
onEnd: async () => { // eslint-disable-line @typescript-eslint/no-misused-promises
const newOrder = Array.from(protectedBranchesList.children, (item) => {
const id = item.getAttribute('data-id');
return id ? parseInt(id, 10) : NaN;
}).filter(id => !isNaN(id));
return id ? parseInt(id) : NaN;
}).filter((id) => !Number.isNaN(id));
try {
await POST(protectedBranchesList.getAttribute('data-priority-url'), {