From 6741d950738e2ab7154a21ea8288428a150f66f3 Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 22 Aug 2024 21:04:15 +1000 Subject: [PATCH] When updating, we need to select the object when making the model --- src/API.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/API.php b/src/API.php index 296619c..b4a610e 100644 --- a/src/API.php +++ b/src/API.php @@ -428,7 +428,9 @@ final class API { Log::debug(sprintf('%s:Update invoice',static::LOGKEY),['params'=>$parameters]); - return new Invoice($this->execute('invoice',array_merge($parameters,['method'=>'POST']))); + $result = $this->execute('invoice',array_merge($parameters,['method'=>'POST'])); + + return new Invoice($result->Invoice); } /** @@ -442,6 +444,8 @@ final class API { Log::debug(sprintf('%s:Update customer',static::LOGKEY),['params'=>$parameters]); - return new Customer($this->execute('customer',array_merge($parameters,['method'=>'POST']))); + $result = $this->execute('customer',array_merge($parameters,['method'=>'POST'])); + + return new Customer($result->Customer); } } \ No newline at end of file