@@ -4425,29 +4425,25 @@ async function handleEditToolFormSubmit(event) {
4425
4425
const response = await fetch ( form . action , {
4426
4426
method : "POST" ,
4427
4427
body : formData ,
4428
- headers : { "X-Requested-With" : "XMLHttpRequest" }
4428
+ headers : { "X-Requested-With" : "XMLHttpRequest" } ,
4429
4429
} ) ;
4430
- console . log ( "response:" , response ) ;
4431
- result = await response . json ( ) ;
4432
- console . log ( "result edit tool form:" , result ) ;
4433
- if ( ! result . success ) {
4430
+ console . log ( "response:" , response ) ;
4431
+ result = await response . json ( ) ;
4432
+ console . log ( "result edit tool form:" , result ) ;
4433
+ if ( ! result . success ) {
4434
4434
throw new Error ( result . message || "An error occurred" ) ;
4435
- }
4436
- else {
4435
+ } else {
4437
4436
const redirectUrl = isInactiveCheckedBool
4438
4437
? `${ window . ROOT_PATH } /admin?include_inactive=true#tools`
4439
4438
: `${ window . ROOT_PATH } /admin#tools` ;
4440
4439
window . location . href = redirectUrl ;
4441
4440
}
4442
-
4443
4441
} catch ( error ) {
4444
4442
console . error ( "Fetch error:" , error ) ;
4445
4443
showErrorMessage ( error . message ) ;
4446
4444
}
4447
4445
}
4448
4446
4449
-
4450
-
4451
4447
// ===================================================================
4452
4448
// ENHANCED FORM VALIDATION for All Forms
4453
4449
// ===================================================================
@@ -4990,7 +4986,6 @@ function setupFormHandlers() {
4990
4986
}
4991
4987
} ) ;
4992
4988
}
4993
-
4994
4989
}
4995
4990
4996
4991
function setupSchemaModeHandlers ( ) {
0 commit comments