Spaces:
Sleeping
Sleeping
Upload 157 files
Browse files
src/apis/controllers/__pycache__/auth_controller.cpython-311.pyc
CHANGED
|
Binary files a/src/apis/controllers/__pycache__/auth_controller.cpython-311.pyc and b/src/apis/controllers/__pycache__/auth_controller.cpython-311.pyc differ
|
|
|
src/apis/controllers/auth_controller.py
CHANGED
|
@@ -10,7 +10,6 @@ jwt_provider = JWTProvider()
|
|
| 10 |
|
| 11 |
async def login_control(token):
|
| 12 |
first_login = False
|
| 13 |
-
print("token", token)
|
| 14 |
if not token:
|
| 15 |
raise HTTPException(
|
| 16 |
status_code=status.HTTP_401_UNAUTHORIZED,
|
|
|
|
| 10 |
|
| 11 |
async def login_control(token):
|
| 12 |
first_login = False
|
|
|
|
| 13 |
if not token:
|
| 14 |
raise HTTPException(
|
| 15 |
status_code=status.HTTP_401_UNAUTHORIZED,
|
src/apis/routes/__pycache__/travel_dest_route.cpython-311.pyc
CHANGED
|
Binary files a/src/apis/routes/__pycache__/travel_dest_route.cpython-311.pyc and b/src/apis/routes/__pycache__/travel_dest_route.cpython-311.pyc differ
|
|
|
src/apis/routes/travel_dest_route.py
CHANGED
|
@@ -50,6 +50,26 @@ def get_tourist(page: int = Query(default=1, ge=1)):
|
|
| 50 |
)
|
| 51 |
|
| 52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
@router.get("/paginate")
|
| 54 |
async def get_paginated_destinations(
|
| 55 |
page: int = Query(default=1, ge=1), page_size: int = Query(default=10, ge=1, le=100)
|
|
@@ -93,7 +113,6 @@ async def get_paginated_destinations(
|
|
| 93 |
}
|
| 94 |
serialized_data.append(dest_dict)
|
| 95 |
|
| 96 |
-
print(serialized_data)
|
| 97 |
return JSONResponse(
|
| 98 |
content={
|
| 99 |
"data": serialized_data,
|
|
|
|
| 50 |
)
|
| 51 |
|
| 52 |
|
| 53 |
+
@router.get("/destination_detail")
|
| 54 |
+
async def get_destinations(destination_id: str = Query(min_length=1, max_length=50)):
|
| 55 |
+
try:
|
| 56 |
+
destination_data = await DestinationCRUD.find_by_id(destination_id)
|
| 57 |
+
if not destination_data:
|
| 58 |
+
return JSONResponse(
|
| 59 |
+
content={"message": "Destination not found"}, status_code=404
|
| 60 |
+
)
|
| 61 |
+
destination_data.pop("created_at")
|
| 62 |
+
destination_data.pop("updated_at")
|
| 63 |
+
destination_data.pop("expire_at")
|
| 64 |
+
destination_data["id"] = str(destination_data["_id"])
|
| 65 |
+
destination_data.pop("_id")
|
| 66 |
+
|
| 67 |
+
return JSONResponse(content=destination_data, status_code=200)
|
| 68 |
+
|
| 69 |
+
except Exception as e:
|
| 70 |
+
logger.error(f"Error fetching destination: {str(e)}")
|
| 71 |
+
|
| 72 |
+
|
| 73 |
@router.get("/paginate")
|
| 74 |
async def get_paginated_destinations(
|
| 75 |
page: int = Query(default=1, ge=1), page_size: int = Query(default=10, ge=1, le=100)
|
|
|
|
| 113 |
}
|
| 114 |
serialized_data.append(dest_dict)
|
| 115 |
|
|
|
|
| 116 |
return JSONResponse(
|
| 117 |
content={
|
| 118 |
"data": serialized_data,
|