Skip to content

Commit

Permalink
Improve feedback when updating objects via REST without changes
Browse files Browse the repository at this point in the history
  • Loading branch information
larhip committed May 4, 2022
1 parent 8c8ab99 commit 8645e6a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/restservices.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,13 @@ public function ExecOperation($sVersion, $sVerb, $aParams)
{
$oObject = RestUtils::FindObjectFromKey($sClass, $key);
RestUtils::UpdateObjectFromFields($oObject, $aFields);
$oObject->DBUpdate();
$oResult->AddObject(0, 'updated', $oObject, $aShowFields, $bExtendedOutput);
$sMessage = 'unchanged';
if($oObject->IsModified())
{
$oObject->DBUpdate();
$sMessage = 'updated';
}
$oResult->AddObject(0, $sMessage, $oObject, $aShowFields, $bExtendedOutput);
}
break;

Expand Down

0 comments on commit 8645e6a

Please sign in to comment.