Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete projects api made authenticated #1042

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/backend/app/projects/project_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
from shapely.ops import unary_union
from sqlalchemy.orm import Session

from app.auth.osm import AuthUser, login_required

from ..central import central_crud
from ..db import database, db_models
from ..models.enums import TILES_FORMATS, TILES_SOURCE
Expand Down Expand Up @@ -205,7 +207,11 @@ async def read_project(project_id: int, db: Session = Depends(database.get_db)):


@router.delete("/delete/{project_id}")
async def delete_project(project_id: int, db: Session = Depends(database.get_db)):
async def delete_project(
project_id: int,
db: Session = Depends(database.get_db),
user_data: AuthUser = Depends(login_required),
):
"""Delete a project from ODK Central and the local database."""
# FIXME: should check for error

Expand Down