From 649f0b214926c52c369d5fecbd4c558289c06ab7 Mon Sep 17 00:00:00 2001 From: Jos Groot Lipman Date: Mon, 12 Feb 2018 09:39:38 +0000 Subject: [PATCH] UWVA#52203 Flexwhere sensoren werken niet - alle reserveringen no show svn path=/Website/branches/v2017.2/; revision=36924 --- APPL/API2/api2_rest.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/APPL/API2/api2_rest.inc b/APPL/API2/api2_rest.inc index 96023cb053..eaed77ea7b 100644 --- a/APPL/API2/api2_rest.inc +++ b/APPL/API2/api2_rest.inc @@ -157,8 +157,6 @@ api2_rest = { } var key = getQParamInt("id", -1); // Voor POST/PUT/DELETE - if (/PUT|DELETE/.test(method) && !(key > 0)) - api2.error(400, "Missing id"); var jsondata = {}; var filter = shared.qs2json(model); @@ -297,6 +295,8 @@ api2_rest = { { if (method == "DELETE") { + if (!(key > 0)) + api2.error(400, "Missing id"); var result = model["REST_" + method]( requestparams, key ); } else if (filter.mode == "attachment") @@ -387,6 +387,8 @@ api2_rest = { } else if (model.record_name in jsondata) // een enkel record { + if (!(key > 0)) + api2.error(400, "Missing id"); if (jsondata[model.record_name] instanceof Array) api2.error(400, "{0} should be single record only.".format(method))