feat: org dependencies
Org endpoints use query/body model dependencies to perform initial db lookups. Issue #6 Org ID path params have been replaced with either query params (get endpoints) or body values. Resolves #10 Endpoints in other modules that rely on an org model lookup have also been updated.
This commit is contained in:
parent
c6a2b301dc
commit
657f91d73d
9 changed files with 106 additions and 74 deletions
|
|
@ -4,4 +4,16 @@ Module specific exceptions for organisation module
|
|||
Exceptions:
|
||||
- List: Description
|
||||
- Exceptions: Description
|
||||
"""
|
||||
"""
|
||||
from typing import Optional
|
||||
|
||||
from fastapi import HTTPException, status
|
||||
|
||||
|
||||
class OrgNotFoundException(HTTPException):
|
||||
def __init__(self, org_id: Optional[int] = None) -> None:
|
||||
detail = "Organisation not found" if org_id is None else f"User with ID '{org_id}' was not found."
|
||||
super().__init__(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail=detail,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue