fix: fix validation fails with Services (#2258)

This commit is contained in:
Alexis Saettler
2019-01-05 16:24:09 +01:00
committed by GitHub
parent 555515d1c4
commit 95df53135d
88 changed files with 317 additions and 336 deletions
@@ -7,7 +7,7 @@ use App\Helpers\SearchHelper;
use App\Models\Contact\Contact;
use Illuminate\Support\Collection;
use Illuminate\Database\QueryException;
use App\Exceptions\MissingParameterException;
use Illuminate\Validation\ValidationException;
use App\Services\Contact\Contact\CreateContact;
use App\Services\Contact\Contact\UpdateContact;
use App\Services\Contact\Contact\DestroyContact;
@@ -101,8 +101,8 @@ class ApiContactController extends ApiController
);
} catch (ModelNotFoundException $e) {
return $this->respondNotFound();
} catch (MissingParameterException $e) {
return $this->respondInvalidParameters($e->errors);
} catch (ValidationException $e) {
return $this->respondValidatorFailed($e->validator);
} catch (QueryException $e) {
return $this->respondInvalidQuery();
}
@@ -128,8 +128,8 @@ class ApiContactController extends ApiController
);
} catch (ModelNotFoundException $e) {
return $this->respondNotFound();
} catch (MissingParameterException $e) {
return $this->respondInvalidParameters($e->errors);
} catch (ValidationException $e) {
return $this->respondValidatorFailed($e->validator);
} catch (QueryException $e) {
return $this->respondInvalidQuery();
}