Set correct prop check $customerInfo->exists on api v2 customer store

This commit is contained in:
Jérémy Munsch 2021-08-23 21:41:05 +02:00
parent 13b7228b6d
commit aeaa44e8c6

View file

@ -46,7 +46,7 @@ class CustomerController extends Controller
/** @var \App\Models\CustomerInfo */
$customerInfo = $customer->info($service->brand, Customer::FIRST_OR_NEW);
if ($customerInfo->id) {
if ($customerInfo->exists) {
throw new ApiErrorException(ApiError::customerExists());
}
$customerInfo->fill($request->validated());