From aeaa44e8c65dd2f3319d4f15b3743d73cfbefa1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Mon, 23 Aug 2021 21:41:05 +0200 Subject: [PATCH] Set correct prop check $customerInfo->exists on api v2 customer store --- app/Http/Controllers/Api/V2/CustomerController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/V2/CustomerController.php b/app/Http/Controllers/Api/V2/CustomerController.php index 62dbefb..60dfb26 100644 --- a/app/Http/Controllers/Api/V2/CustomerController.php +++ b/app/Http/Controllers/Api/V2/CustomerController.php @@ -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());