feat: org router endpoint cleanup

`/id/` removed from GET
Trailing `/` removed from POST and DELETE
This commit is contained in:
Chris Milne 2026-06-02 16:23:29 +01:00
parent 806bbfcbfc
commit 81a4cc6cca
3 changed files with 8 additions and 8 deletions

View file

@ -25,7 +25,7 @@ def get_org_model(db: Session, request: Request, org_id: int):
root = "/api/v1"
pre_approval_endpoints = [f"PATCH{root}/org/status", f"PATCH{root}/org/questionnaire", f"GET{root}/org/id", f"GET{root}/org/contact", f"PATCH{root}/org/contact"]
pre_approval_endpoints = [f"PATCH{root}/org/status", f"PATCH{root}/org/questionnaire", f"GET{root}/org", f"GET{root}/org/contact", f"PATCH{root}/org/contact"]
current_request = f"{request.method}{request.url.path}"
if current_request not in pre_approval_endpoints and org_model.status != OrgStatus.APPROVED:
raise AwaitingApprovalException(org_id)