generated from coulomb/repo-seed
advanced the review workflow
This commit is contained in:
@@ -73,6 +73,10 @@ class CandidateGraphApproval(BaseModel):
|
||||
notes: str = ""
|
||||
|
||||
|
||||
class CandidateRejection(BaseModel):
|
||||
notes: str = ""
|
||||
|
||||
|
||||
app = FastAPI(title="Repository Ability Registry", version="0.1.0")
|
||||
|
||||
|
||||
@@ -189,6 +193,30 @@ def approve_candidate_graph(
|
||||
raise HTTPException(status_code=404, detail=str(exc)) from exc
|
||||
|
||||
|
||||
@app.post(
|
||||
"/repos/{repository_id}/analysis-runs/{analysis_run_id}"
|
||||
"/candidate-abilities/{candidate_ability_id}/reject"
|
||||
)
|
||||
def reject_candidate_ability(
|
||||
repository_id: int,
|
||||
analysis_run_id: int,
|
||||
candidate_ability_id: int,
|
||||
payload: CandidateRejection,
|
||||
service: RegistryService = Depends(get_service),
|
||||
) -> dict[str, object]:
|
||||
try:
|
||||
return asdict(
|
||||
service.reject_candidate_ability(
|
||||
repository_id,
|
||||
analysis_run_id,
|
||||
candidate_ability_id,
|
||||
notes=payload.notes,
|
||||
)
|
||||
)
|
||||
except NotFoundError as exc:
|
||||
raise HTTPException(status_code=404, detail=str(exc)) from exc
|
||||
|
||||
|
||||
@app.post("/repos/{repository_id}/abilities", status_code=201)
|
||||
def create_ability(
|
||||
repository_id: int,
|
||||
|
||||
Reference in New Issue
Block a user