aboutsummaryrefslogtreecommitdiff
path: root/app/apis.py
diff options
context:
space:
mode:
authorNavan Chauhan <navanchauhan@gmail.com>2021-06-06 15:49:56 +0530
committerNavan Chauhan <navanchauhan@gmail.com>2021-06-06 15:49:56 +0530
commit812220acbfd41aea0382fcd9a37a989a4b091d66 (patch)
tree0f4277216efe81e6b8d21d9dfc39a3d343fac48e /app/apis.py
parentad92a42e8439337cfde346fa84e75a5f91164eac (diff)
parent62a5ca363415b0f6f98785b6c3522a71fc895a72 (diff)
fixing pull
Diffstat (limited to 'app/apis.py')
-rw-r--r--app/apis.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/app/apis.py b/app/apis.py
index 51e8987..b81882e 100644
--- a/app/apis.py
+++ b/app/apis.py
@@ -4,17 +4,17 @@ from fastapi import Body, FastAPI, HTTPException
from fastapi.middleware.wsgi import WSGIMiddleware
from pydantic import BaseModel
+
@app.get("/version")
async def API_Version():
- return {"message":app.version}
+ return {"message": app.version}
+
@app.get("/v1/user-details")
async def API_User_Details(email: str):
- user = models.User.query.filter_by(email=email).first()
- try:
- assert user != None
- except AssertionError:
- raise HTTPException(status_code=404, detail="User Not Found")
- return {
- "first_name":user.first_name,
- "last_name":user.last_name} \ No newline at end of file
+ user = models.User.query.filter_by(email=email).first()
+ try:
+ assert user != None
+ except AssertionError:
+ raise HTTPException(status_code=404, detail="User Not Found")
+ return {"first_name": user.first_name, "last_name": user.last_name}