feat: org router endpoint cleanup
`/id/` removed from GET Trailing `/` removed from POST and DELETE
This commit is contained in:
parent
806bbfcbfc
commit
81a4cc6cca
3 changed files with 8 additions and 8 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue