Spaces:
Build error
Build error
| from fastapi import APIRouter, Request, HTTPException | |
| from app.services.auth_service import register_user_service | |
| from app.models.auth_models import RegisterUser | |
| insightfy_router = APIRouter() | |
| book_my_service_router = APIRouter() | |
| async def register_user_insightfy(request: Request, user: RegisterUser): | |
| """ | |
| Register a new user for Insightfy with enhanced validations. | |
| """ | |
| try: | |
| return await register_user_service(request, email=user.email, mobile=user.mobile, name=user.name) | |
| except HTTPException as e: | |
| raise e | |
| except Exception as e: | |
| raise HTTPException(status_code=500, detail=str(e)) | |
| async def register_user_book_my_service(request: Request, user: RegisterUser): | |
| """ | |
| Register a new user for Book My Service with enhanced validations. | |
| """ | |
| try: | |
| return await register_user_service(request, email=user.email, mobile=user.mobile, name=user.name) | |
| except HTTPException as e: | |
| raise e | |
| except Exception as e: | |
| raise HTTPException(status_code=500, detail=str(e)) |