-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #711 from kikeelectronico/refactor_rest_api
Refactor rest api
- Loading branch information
Showing
23 changed files
with
789 additions
and
973 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from fastapi.responses import JSONResponse | ||
|
||
FOUR_O_ONE = JSONResponse(status_code=401, | ||
content = { | ||
"error": "Authentication is needed", | ||
"code": 401, | ||
"note": "See the documentation https://homeware.enriquegomez.me/api-docs.html" | ||
}) | ||
|
||
FOUR_O_THREE = JSONResponse(status_code=403, | ||
content = { | ||
"error": "Authentication fail", | ||
"code": 403, | ||
"note": "See the documentation https://homeware.enriquegomez.me/api-docs.html" | ||
}) | ||
|
||
FOUR_O_FOUR = JSONResponse(status_code=404, | ||
content = { | ||
"error": "Not found", | ||
"code": 404, | ||
"note": "See the documentation https://homeware.enriquegomez.me/" | ||
}) | ||
|
||
FOUR_O_O = JSONResponse(status_code=400, | ||
content = { | ||
"error": "Operation not supported", | ||
"code": 400, | ||
"note": "See the documentation https://homeware.enriquegomez.me/" | ||
}) |
Oops, something went wrong.