diff --git a/ooniapi/services/oonifindings/src/oonifindings/routers/v1.py b/ooniapi/services/oonifindings/src/oonifindings/routers/v1.py index 041e0265..5cc3a218 100644 --- a/ooniapi/services/oonifindings/src/oonifindings/routers/v1.py +++ b/ooniapi/services/oonifindings/src/oonifindings/routers/v1.py @@ -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"], @@ -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), ): @@ -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)