diff --git a/src/flextype/core/Endpoints/errors.php b/src/flextype/core/Endpoints/errors.php deleted file mode 100644 index 2a834ab5..00000000 --- a/src/flextype/core/Endpoints/errors.php +++ /dev/null @@ -1,39 +0,0 @@ - [ - 'http_status_code' => 400, - 'title' => 'Bad Request', - 'message' => 'Validation for this particular item failed', - ], - '401' => [ - 'http_status_code' => 401, - 'title' => 'Unauthorized', - 'message' => 'Token is wrong', - ], - '404' => [ - 'http_status_code' => 404, - 'title' => 'Not Found', - 'message' => 'Not Found', - ], - ]; -} - -function getApiResponseWithError($response, $code) -{ - $response->getBody()->write(serializers()->json()->encode(getApiResponseErrors()[$code])); - $response->withStatus(getApiResponseErrors()[$code]['http_status_code']); - $response->withHeader('Content-Type', 'application/json;charset=' . registry()->get('flextype.settings.charset')); - return $response; -} \ No newline at end of file