- Fix customers infos

This commit is contained in:
Vincent BRIDIER 2021-02-17 15:24:31 +01:00
parent c411153dca
commit daa5e6261f

View file

@ -198,6 +198,7 @@ class CustomerController extends Controller
if ($login) {
if (Hash::check($password, $login->password)) {
if ($login->status === 0) {
$infos = $customer->infos()->where('brand_id', $brandId)->first();
// "Le compte de l'utilisateur n'est pas activé"
return new StatusResource(
[
@ -206,17 +207,17 @@ class CustomerController extends Controller
'message' => 'Account not activated.',
'user' => [
'crm_id' => $customer->id,
'firstname' => $customer->infos()->firstname,
'lastname' => $customer->infos()->lastname,
'birth_date' => $customer->infos()->birth_date,
'address' => $customer->infos()->address,
'address2' => $customer->infos()->address2,
'phone' => $customer->infos()->phone,
'country' => $customer->infos()->country,
'city' => $customer->infos()->city,
'postcode' => $customer->infos()->postcode,
'opt_in' => $customer->infos()->opt_in,
'hashcode' => $customer->infos()->hashcode,
'firstname' => $infos->firstname,
'lastname' => $infos->lastname,
'birth_date' => $infos->birth_date,
'address' => $infos->address,
'address2' => $infos->address2,
'phone' => $infos->phone,
'country' => $infos->country,
'city' => $infos->city,
'postcode' => $infos->postcode,
'opt_in' => $infos->opt_in,
'hashcode' => $infos->hashcode,
'status' => $login->status,
]
]);