Merge pull request #2601 from laf/api-devices-patch

Small fix so that updates report back as ok even if no update is done due to no change
This commit is contained in:
Daniel Preussker
2015-12-11 08:45:01 +00:00

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;