fix: 🐛 update claim customer relation with hashcode
This commit is contained in:
parent
3d25f43f8d
commit
a7be8bbc46
2 changed files with 5 additions and 4 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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') {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue