Small fix so that updates report back as ok even if no update is done due to no change

This commit is contained in:
laf
2015-12-10 21:26:59 +00:00
parent 810f53fac7
commit 3c0b3eb486

View File

@@ -997,7 +997,7 @@ function update_device() {
$message = 'Device field is not allowed to be updated';
}
else {
if (dbUpdate(array(mres($data['field']) => mres($data['data'])), 'devices', '`device_id`=?', array($device_id))) {
if (dbUpdate(array(mres($data['field']) => mres($data['data'])), 'devices', '`device_id`=?', array($device_id)) >= 0) {
$status = 'ok';
$message = 'Device ' . mres($data['field']) . ' field has been updated';
$code = 200;