Skip to content

Commit

Permalink
Added a patch() function
Browse files Browse the repository at this point in the history
  • Loading branch information
killua-eu committed Oct 27, 2024
1 parent 106261f commit e8181ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public function patch(string $uuid, array | object $patch): object
$doc = $this->get($uuid);
if (!$doc) { throw new \Exception('Empty patch doc.', 400); }
$patchHandler = new JsonMergePatch();
$new = $patchHandler->apply($doc, $patch);
$new = $patchHandler->apply((object) $doc, (object) $patch);
$this->update($uuid,$new);
$this->pdo->commit();
return $new;
Expand Down

0 comments on commit e8181ee

Please sign in to comment.