mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user