generated from coulomb/repo-seed
Added rejection support for the rest of the candidate graph
This commit is contained in:
@@ -224,6 +224,78 @@ def reject_candidate_ability(
|
||||
raise HTTPException(status_code=404, detail=str(exc)) from exc
|
||||
|
||||
|
||||
@app.post(
|
||||
"/repos/{repository_id}/analysis-runs/{analysis_run_id}"
|
||||
"/candidate-capabilities/{candidate_capability_id}/reject"
|
||||
)
|
||||
def reject_candidate_capability(
|
||||
repository_id: int,
|
||||
analysis_run_id: int,
|
||||
candidate_capability_id: int,
|
||||
payload: CandidateRejection,
|
||||
service: RegistryService = Depends(get_service),
|
||||
) -> dict[str, object]:
|
||||
try:
|
||||
return asdict(
|
||||
service.reject_candidate_capability(
|
||||
repository_id,
|
||||
analysis_run_id,
|
||||
candidate_capability_id,
|
||||
notes=payload.notes,
|
||||
)
|
||||
)
|
||||
except NotFoundError as exc:
|
||||
raise HTTPException(status_code=404, detail=str(exc)) from exc
|
||||
|
||||
|
||||
@app.post(
|
||||
"/repos/{repository_id}/analysis-runs/{analysis_run_id}"
|
||||
"/candidate-features/{candidate_feature_id}/reject"
|
||||
)
|
||||
def reject_candidate_feature(
|
||||
repository_id: int,
|
||||
analysis_run_id: int,
|
||||
candidate_feature_id: int,
|
||||
payload: CandidateRejection,
|
||||
service: RegistryService = Depends(get_service),
|
||||
) -> dict[str, object]:
|
||||
try:
|
||||
return asdict(
|
||||
service.reject_candidate_feature(
|
||||
repository_id,
|
||||
analysis_run_id,
|
||||
candidate_feature_id,
|
||||
notes=payload.notes,
|
||||
)
|
||||
)
|
||||
except NotFoundError as exc:
|
||||
raise HTTPException(status_code=404, detail=str(exc)) from exc
|
||||
|
||||
|
||||
@app.post(
|
||||
"/repos/{repository_id}/analysis-runs/{analysis_run_id}"
|
||||
"/candidate-evidence/{candidate_evidence_id}/reject"
|
||||
)
|
||||
def reject_candidate_evidence(
|
||||
repository_id: int,
|
||||
analysis_run_id: int,
|
||||
candidate_evidence_id: int,
|
||||
payload: CandidateRejection,
|
||||
service: RegistryService = Depends(get_service),
|
||||
) -> dict[str, object]:
|
||||
try:
|
||||
return asdict(
|
||||
service.reject_candidate_evidence(
|
||||
repository_id,
|
||||
analysis_run_id,
|
||||
candidate_evidence_id,
|
||||
notes=payload.notes,
|
||||
)
|
||||
)
|
||||
except NotFoundError as exc:
|
||||
raise HTTPException(status_code=404, detail=str(exc)) from exc
|
||||
|
||||
|
||||
@app.patch(
|
||||
"/repos/{repository_id}/analysis-runs/{analysis_run_id}"
|
||||
"/candidate-abilities/{candidate_ability_id}"
|
||||
|
||||
Reference in New Issue
Block a user