From e8181eee8a29b06a41ed172492bb18c0d1407e04 Mon Sep 17 00:00:00 2001 From: Pavel Stratil Date: Sun, 27 Oct 2024 02:35:59 +0200 Subject: [PATCH] Added a patch() function --- src/Sql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Sql.php b/src/Sql.php index 8841c57..6c86cd4 100644 --- a/src/Sql.php +++ b/src/Sql.php @@ -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;