From c64759f05b924d9030b7712a8f80f356743660b9 Mon Sep 17 00:00:00 2001 From: Christopher Pitt Date: Tue, 7 May 2019 19:32:25 +0200 Subject: [PATCH] Format updateItem fields like createItem fields This makes updateItem work similarly to createItem, and avoids the need to further nest $fields at the call-site. --- src/Webflow/Api.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Webflow/Api.php b/src/Webflow/Api.php index 9e5bdcd..5c46f9f 100644 --- a/src/Webflow/Api.php +++ b/src/Webflow/Api.php @@ -174,7 +174,9 @@ public function createItem(string $collectionId, array $fields) public function updateItem(string $collectionId, string $itemId, array $fields) { - return $this->put("/collections/{$collectionId}/items/{$itemId}", $fields); + return $this->put("/collections/{$collectionId}/items/{$itemId}", [ + 'fields' => $fields, + ]); } public function removeItem(string $collectionId, $itemId)