diff --git a/nodejs/public/lib/js/app-base.js b/nodejs/public/lib/js/app-base.js index 2b323a3..d5fff48 100644 --- a/nodejs/public/lib/js/app-base.js +++ b/nodejs/public/lib/js/app-base.js @@ -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({