File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -160,21 +160,21 @@ public function item(string $collectionId, string $itemId)
160160 return $ this ->get ("/collections/ {$ collectionId }/items/ {$ itemId }" );
161161 }
162162
163- public function createItem (string $ collectionId , array $ fields )
163+ public function createItem (string $ collectionId , array $ fields, bool $ live = false )
164164 {
165165 $ defaults = [
166166 "_archived " => false ,
167167 "_draft " => false ,
168168 ];
169169
170- return $ this ->post ("/collections/ {$ collectionId }/items " , [
171- 'fields ' => array_merge ($ defaults , $ fields ),
170+ return $ this ->post ("/collections/ {$ collectionId }/items " . ( $ live ? " ?live=true " : "" ) , [
171+ 'fields ' => array_merge ($ defaults , $ fields ),
172172 ]);
173173 }
174174
175- public function updateItem (string $ collectionId , string $ itemId , array $ fields )
175+ public function updateItem (string $ collectionId , string $ itemId , array $ fields, bool $ live = false )
176176 {
177- return $ this ->put ("/collections/ {$ collectionId }/items/ {$ itemId }" , [
177+ return $ this ->put ("/collections/ {$ collectionId }/items/ {$ itemId }" . ( $ live ? " ?live=true " : "" ) , [
178178 'fields ' => $ fields ,
179179 ]);
180180 }
You can’t perform that action at this time.
0 commit comments