Skip to content

Commit

Permalink
Make publish behave like current backend
Browse files Browse the repository at this point in the history
  • Loading branch information
hellais committed Oct 11, 2024
1 parent fd77b16 commit dc4e4d3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ooniapi/services/oonifindings/src/oonifindings/routers/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,10 @@ def delete_oonifinding(
return {}


class OONIFindingsPublish(BaseModel):
id: str = Field(title="ID of the finding")


@router.post(
"/v1/incidents/{action}",
tags=["oonifindings"],
Expand All @@ -501,7 +505,7 @@ def delete_oonifinding(
)
def update_oonifinding_publish_status(
action: str,
publish_request: OONIFindingCreateUpdate,
publish_request: OONIFindingsPublish,
response: Response,
db=Depends(get_postgresql_session),
):
Expand All @@ -512,7 +516,7 @@ def update_oonifinding_publish_status(
raise HTTPException(status_code=400, detail="Invalid query action")

assert publish_request
finding_id = publish_request.incident_id
finding_id = publish_request.id

q = db.query(models.OONIFinding).filter(models.OONIFinding.finding_id == finding_id)

Expand Down

0 comments on commit dc4e4d3

Please sign in to comment.