fix: 🐛 set brand id from service in claim call #52
This commit is contained in:
parent
c5cb57d88a
commit
6ceb32fdca
3 changed files with 3 additions and 4 deletions
|
|
@ -32,6 +32,9 @@ class ClaimController extends Controller
|
|||
);
|
||||
}
|
||||
|
||||
// Add brand id from service.
|
||||
$claimModel->brand_id = $service->brand->getKey();
|
||||
|
||||
// Add customer relation if exist.
|
||||
$crmCustomer = CustomerInfo::getFromEmail($claimModel->brand, $claimModel->email)->first();
|
||||
if (!is_null($crmCustomer)) {
|
||||
|
|
|
|||
|
|
@ -80,7 +80,6 @@ class SendClaimRequest extends BaseApiRequest
|
|||
}
|
||||
],
|
||||
'message' => 'required|string|min:3',
|
||||
'brand_id' => 'required|integer|exists:brands,id',
|
||||
'subject_id' => 'required|integer|exists:claim_subjects,id',
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ class CrmClientClaimTest extends CrmClientTester
|
|||
'claim@hotmail.fr',
|
||||
'Ceci est un message.',
|
||||
1,
|
||||
1,
|
||||
'10 rue des totos',
|
||||
'Le Mans',
|
||||
'72100',
|
||||
|
|
@ -55,7 +54,6 @@ class CrmClientClaimTest extends CrmClientTester
|
|||
'claim@hotmail.fr',
|
||||
'Ceci est un message.',
|
||||
1,
|
||||
1,
|
||||
));
|
||||
$this->assertTrue(ModelsClaim::query()->where('email', 'claim@hotmail.fr')->exists());
|
||||
}
|
||||
|
|
@ -74,7 +72,6 @@ class CrmClientClaimTest extends CrmClientTester
|
|||
'claim@hotmail.fr',
|
||||
'Ceci est un message.',
|
||||
0,
|
||||
0,
|
||||
);
|
||||
$this->assertSame(0, ModelsClaim::count());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue