Skip to content

Commit

Permalink
delete projects api made authenticated
Browse files Browse the repository at this point in the history
  • Loading branch information
nrjadkry committed Dec 12, 2023
1 parent c4dbd08 commit 06ace87
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/backend/app/projects/project_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
from shapely.geometry import mapping, shape
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
Expand Down Expand Up @@ -205,7 +206,10 @@ 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

0 comments on commit 06ace87

Please sign in to comment.