File tree Expand file tree Collapse file tree 2 files changed +23
-16
lines changed Expand file tree Collapse file tree 2 files changed +23
-16
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,11 @@ async function initIssuePinSort() {
196196
197197 createSortable ( pinDiv , {
198198 group : 'shared' ,
199- onEnd : pinMoveEnd , // eslint-disable-line @typescript-eslint/no-misused-promises
199+ onEnd : ( e ) => {
200+ ( async ( ) => {
201+ await pinMoveEnd ( e ) ;
202+ } ) ( ) ;
203+ } ,
200204 } ) ;
201205}
202206
Original file line number Diff line number Diff line change @@ -9,22 +9,25 @@ export function initRepoBranchesSettings() {
99 createSortable ( protectedBranchesList , {
1010 handle : '.drag-handle' ,
1111 animation : 150 ,
12- onEnd : async ( ) => { // eslint-disable-line @typescript-eslint/no-misused-promises
13- const newOrder = Array . from ( protectedBranchesList . children , ( item ) => {
14- const id = item . getAttribute ( 'data-id' ) ;
15- return parseInt ( id ) ;
16- } ) . filter ( ( id ) => ! Number . isNaN ( id ) ) ;
1712
18- try {
19- await POST ( protectedBranchesList . getAttribute ( 'data-update-priority-url' ) , {
20- data : {
21- ids : newOrder ,
22- } ,
23- } ) ;
24- } catch ( err ) {
25- const errorMessage = String ( err ) ;
26- showErrorToast ( `Failed to update branch protection rule priority:, error: ${ errorMessage } ` ) ;
27- }
13+ onEnd : ( ) => {
14+ ( async ( ) => {
15+ const newOrder = Array . from ( protectedBranchesList . children , ( item ) => {
16+ const id = item . getAttribute ( 'data-id' ) ;
17+ return parseInt ( id ) ;
18+ } ) . filter ( ( id ) => ! Number . isNaN ( id ) ) ;
19+
20+ try {
21+ await POST ( protectedBranchesList . getAttribute ( 'data-update-priority-url' ) , {
22+ data : {
23+ ids : newOrder ,
24+ } ,
25+ } ) ;
26+ } catch ( err ) {
27+ const errorMessage = String ( err ) ;
28+ showErrorToast ( `Failed to update branch protection rule priority:, error: ${ errorMessage } ` ) ;
29+ }
30+ } ) ( ) ;
2831 } ,
2932 } ) ;
3033}
You can’t perform that action at this time.
0 commit comments