Skip to content

Commit ab736be

Browse files
committed
wip: update GET all officers
1 parent ce28f15 commit ab736be

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/elections/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def _raise_if_bad_election_data(
8888
description="Returns a list of all election & their status",
8989
response_model=list[ElectionResponse],
9090
responses={
91-
404: { "description": "No election found" }
91+
404: { "description": "No election found", "model": DetailModel }
9292
},
9393
operation_id="get_all_elections"
9494
)

src/officers/urls.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from officers.tables import OfficerInfo, OfficerTerm
1010
from officers.types import InitialOfficerInfo, OfficerInfoUpload, OfficerTermUpload
1111
from permission.types import OfficerPrivateInfo, WebsiteAdmin
12+
from utils.shared_models import DetailModel
1213
from utils.urls import logged_in_or_raise
1314

1415
router = APIRouter(
@@ -62,6 +63,9 @@ async def current_officers(
6263
"/all",
6364
description="Information for all execs from all exec terms",
6465
response_model=list[PrivateOfficerResponse] | list[PublicOfficerResponse],
66+
responses={
67+
401: { "description": "not authorized to view private info", "model": DetailModel }
68+
},
6569
operation_id="get_all_officers"
6670
)
6771
async def all_officers(

0 commit comments

Comments
 (0)