diff --git a/web/app/Http/Controllers/Api/Request/ApiRequest.php b/web/app/Http/Controllers/Api/Request/ApiRequest.php index 2ff60b14..3b540f4b 100644 --- a/web/app/Http/Controllers/Api/Request/ApiRequest.php +++ b/web/app/Http/Controllers/Api/Request/ApiRequest.php @@ -13,7 +13,7 @@ public function failedValidation(Validator $validator) throw new HttpResponseException(response()->json([ 'error' => true, 'message' => $validator->errors()->first(), - 'data' => $validator->errors(), + 'errors' => $validator->errors(), ])); } } diff --git a/web/tests/Unit/SecurityTest.php b/web/tests/Unit/SecurityTest.php index 308687a9..f8093fd3 100644 --- a/web/tests/Unit/SecurityTest.php +++ b/web/tests/Unit/SecurityTest.php @@ -20,12 +20,12 @@ public function testSecurity() $this->assertArrayHasKey('error', $callHostingSubscriptionStoreResponse); $this->assertArrayHasKey('message', $callHostingSubscriptionStoreResponse); - $this->assertArrayHasKey('data', $callHostingSubscriptionStoreResponse); - $this->assertArrayHasKey('domain', $callHostingSubscriptionStoreResponse['data']); + $this->assertArrayHasKey('errors', $callHostingSubscriptionStoreResponse); + $this->assertArrayHasKey('domain', $callHostingSubscriptionStoreResponse['errors']); $this->assertSame('The selected customer id is invalid.', $callHostingSubscriptionStoreResponse['message']); - $this->assertSame('The selected hosting plan id is invalid.', $callHostingSubscriptionStoreResponse['data']['hosting_plan_id'][0]); - $this->assertSame('The domain field format is invalid.', $callHostingSubscriptionStoreResponse['data']['domain'][0]); + $this->assertSame('The selected hosting plan id is invalid.', $callHostingSubscriptionStoreResponse['errors']['hosting_plan_id'][0]); + $this->assertSame('The domain field format is invalid.', $callHostingSubscriptionStoreResponse['errors']['domain'][0]); // Create a customer