mirror of
https://github.com/go-gitea/gitea
synced 2024-12-01 07:13:02 +01:00
address TS review
This commit is contained in:
parent
3614fad595
commit
f0658d3ec4
1 changed files with 2 additions and 4 deletions
|
@ -2,9 +2,7 @@ import {createSortable} from '../modules/sortable.ts';
|
||||||
import {POST} from '../modules/fetch.ts';
|
import {POST} from '../modules/fetch.ts';
|
||||||
|
|
||||||
export function initRepoBranchesSettings() {
|
export function initRepoBranchesSettings() {
|
||||||
const protectedBranchesList = document.querySelector(
|
const protectedBranchesList = document.querySelector('#protected-branches-list');
|
||||||
'#protected-branches-list',
|
|
||||||
);
|
|
||||||
if (!protectedBranchesList) return;
|
if (!protectedBranchesList) return;
|
||||||
|
|
||||||
createSortable(protectedBranchesList, {
|
createSortable(protectedBranchesList, {
|
||||||
|
@ -13,7 +11,7 @@ export function initRepoBranchesSettings() {
|
||||||
onEnd: async () => { // 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 newOrder = Array.from(protectedBranchesList.children, (item) => {
|
||||||
const id = item.getAttribute('data-id');
|
const id = item.getAttribute('data-id');
|
||||||
return id ? parseInt(id) : NaN;
|
return parseInt(id);
|
||||||
}).filter((id) => !Number.isNaN(id));
|
}).filter((id) => !Number.isNaN(id));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue