From a7be8bbc46dee9fc633fb407fbdb1acebd701d92 Mon Sep 17 00:00:00 2001 From: Alexis Gousseau Date: Mon, 6 Oct 2025 16:48:44 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20update=20claim=20customer?= =?UTF-8?q?=20relation=20with=20hashcode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Models/Claim.php | 8 +++++--- src/Transport/Response.php | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Models/Claim.php b/src/Models/Claim.php index c2cd34a..687f706 100644 --- a/src/Models/Claim.php +++ b/src/Models/Claim.php @@ -31,7 +31,7 @@ abstract class Claim extends ClientModel 'message' => 'required|string|min:3', 'brand_id' => 'required|int|min:1', 'subject_id' => 'required|int|min:1', - 'customer_id' => 'sometimes|nullable|int|min:1', + 'hashcode' => 'sometimes|nullable|string|size:36', ]; /** @@ -80,8 +80,10 @@ abstract class Claim extends ClientModel ); // Add customer relation if exist. - $crmCustomer = (new CrmApiV4())->getCustomer($email); - $params['customer_id'] = $crmCustomer; + $crmCustomer = (new CrmApiV4())->getCustomer($email); + if (!is_null($crmCustomer)) { + $params['hashcode'] = $crmCustomer->hashcode; + } // Validate all data. foreach ($params as $key => $value) { diff --git a/src/Transport/Response.php b/src/Transport/Response.php index c6bb81d..af54657 100644 --- a/src/Transport/Response.php +++ b/src/Transport/Response.php @@ -101,7 +101,6 @@ class Response $this->message = $response->getReasonPhrase(); } - // * Body should be json data. if (($decodedJson = $this->tryDecodeJson($this->body->getContents())) === false) { if (Utils::getConfig('app.env') === 'testing') {