regirstation works but shared links broken

This commit is contained in:
2025-12-12 20:38:35 +05:00
parent 4d3085623a
commit 1f088c8fb0
23 changed files with 1739 additions and 5 deletions

View File

@@ -9,6 +9,7 @@ from app.dependencies import get_current_user, get_optional_current_user
from app.models.user import User
from app.schemas.map import MapCreate, MapUpdate, MapResponse
from app.services import map_service
from app.services import map_share_service
router = APIRouter(prefix="/api/maps", tags=["maps"])
@@ -49,6 +50,16 @@ async def get_public_map(db: Session = Depends(get_db)):
return public_map
@router.get("/shared/{token}", response_model=MapResponse)
async def get_shared_map(
token: str,
db: Session = Depends(get_db)
):
"""Get a map by share token (no authentication required)."""
map_obj, permission = map_share_service.get_map_by_share_token(db, token)
return map_obj
@router.get("/{map_id}", response_model=MapResponse)
async def get_map(
map_id: UUID,