app.api.delete: accept the (url, data, callback) form formAJAX uses

formAJAX always passes the serialized form as the second argument, so a
DELETE-method form (proxy's host/DNS rows) landed its callback in the
data slot and never ran.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-25 23:15:07 -04:00
parent 208762f0d1
commit d8b6f6e7a3
+8 -1
View File
@@ -129,7 +129,14 @@ app.api = (function(app){
return body('PUT', url, data, callback);
}
function remove(url, callback){
// Called both as (url, callback) and — from formAJAX, which always passes
// the serialized form as the second argument — as (url, data, callback).
// No request body is sent either way.
function remove(url, data, callback){
if(typeof data === 'function'){
callback = data;
data = undefined;
}
if(typeof callback !== 'function'){
return new Promise(function(resolve, reject){
$.ajax({