Skip to content

Commit 93652b4

Browse files
committed
Patch action handle old and new model
1 parent 7840d9d commit 93652b4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

HTTPController.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,12 @@ function patchAction ($req) {
128128
$result = $this->Model->write($req->getParameters(), $req->getItem());
129129
if ($result) {
130130
$retVal['success'] = true;
131-
$retVal['result']->setItems($result[0]);
132-
$retVal['result']->setCount($result[1]);
131+
if (is_array($result)) {
132+
$retVal['result']->setItems($result[0]);
133+
$retVal['result']->setCount($result[1]);
134+
} else {
135+
$retVal['result'] = $result;
136+
}
133137
} else {
134138
$retVal['msg'] = 'Write failed';
135139
}

0 commit comments

Comments
 (0)