From 6a460c3729098b0faa87d8c81b4c5d93758a0f0d Mon Sep 17 00:00:00 2001 From: Stefan Ninic Date: Fri, 12 Apr 2019 17:19:03 +0200 Subject: [PATCH] Update product stock --- src/Models/Product.php | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/Models/Product.php b/src/Models/Product.php index 4b3a478..3568165 100644 --- a/src/Models/Product.php +++ b/src/Models/Product.php @@ -1,18 +1,28 @@ $data, + ]; + + return $this->request->handleWithExceptions( function () use ( $data, $id ) { + + $response = + $this->request->client->put( "products/{$this->{urlencode($this->primaryKey)}}/stockItems/{$id}", [ + 'json' => $data, + ] ); + + return $response; + } ); + } }