Saving current progress with change from using Query() to Path()

This commit is contained in:
Scott Idem
2024-04-26 14:51:11 -04:00
parent b37f14d25c
commit f4eda34035
67 changed files with 236 additions and 236 deletions

View File

@@ -1,5 +1,5 @@
import datetime, time
from fastapi import APIRouter, Body, Depends, Header, HTTPException, Query, Response, status
from fastapi import APIRouter, Body, Depends, Header, HTTPException, Path, Query, Response, status
from pydantic import BaseModel, EmailStr, Field
from typing import Dict, List, Optional, Set, Union
@@ -47,7 +47,7 @@ async def post_event_obj(
@router.patch('/event/{event_id}', response_model=Resp_Body_Base)
async def patch_event(
event_obj: Event_Base,
event_id: str = Query(..., min_length=11, max_length=22),
event_id: str = Path(min_length=11, max_length=22),
create_sub_obj: bool = False,
x_account_id: Optional[str] = Header(..., ),
return_obj: Optional[bool] = True,
@@ -208,7 +208,7 @@ async def get_event_obj_li(
# Updated 2021-12-13
@router.get('/event/{event_id}', response_model=Resp_Body_Base)
async def get_event_obj(
event_id: str = Query(..., min_length=11, max_length=22),
event_id: str = Path(min_length=11, max_length=22),
enabled: str = 'enabled', # enabled, disabled, all
approved: str = 'all', # approve(d), not_approved, all
hidden: str = 'not_hidden', # hidden, not_hidden, all
@@ -313,7 +313,7 @@ async def get_event_obj(
# Updated 2021-12-13
@router.get('/account/{account_id}/event/list', response_model=Resp_Body_Base)
async def get_account_obj_event_list(
account_id: str = Query(..., min_length=11, max_length=22),
account_id: str = Path(min_length=11, max_length=22),
limit: int = 500,
enabled: str = 'enabled',
archived: str = 'not_archived', # archived, not_archived, all
@@ -425,7 +425,7 @@ async def get_account_obj_event_list(
# Updated 2021-12-13
@router.get('/account/{account_id}/event/meeting_list_flat', response_model=Resp_Body_Base)
async def get_account_obj_event_meeting_list_flat(
account_id: str = Query(..., min_length=11, max_length=22),
account_id: str = Path(min_length=11, max_length=22),
limit: int = 500,
enabled: str = 'enabled',
archived: str = 'not_archived', # archived, not_archived, all
@@ -476,7 +476,7 @@ async def get_account_obj_event_meeting_list_flat(
# Updated 2021-07-12
@router.get('/person/{person_id}/event/list', response_model=Resp_Body_Base)
async def get_person_event_obj_li(
person_id: str = Query(..., min_length=1, max_length=22),
person_id: str = Path(min_length=11, max_length=22),
enabled: str = 'enabled',
limit: int = 1000,
conference: bool = False, # If it is a conference then organization, person, and user are queried as participants (not the owner/organizer)
@@ -546,7 +546,7 @@ async def get_person_event_obj_li(
@router.delete('/event/{obj_id}', response_model=Resp_Body_Base)
async def delete_event_obj(
obj_id: str = Query(..., min_length=1, max_length=22),
obj_id: str = Path(min_length=11, max_length=22),
x_account_id: str = Header(...),
response: Response = Response,
):