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_badge_obj(
@router.patch('/event/badge/{obj_id}', response_model=Resp_Body_Base)
async def patch_event_badge_obj(
obj: Event_Badge_Base,
obj_id: str = Query(..., min_length=1, max_length=22),
obj_id: str = Path(min_length=11, max_length=22),
x_account_id: Optional[str] = Header(..., ),
return_obj: Optional[bool] = True,
by_alias: Optional[bool] = True,
@@ -141,7 +141,7 @@ async def get_event_badge_obj_li(
# Updated 2022-02-15
@router.get('/event/{event_id}/badge/search', response_model=Resp_Body_Base)
async def search_event_badge_obj_li(
event_id: str = Query(None, min_length=11, max_length=22),
event_id: str = Path(min_length=11, max_length=22),
event_badge_id: str = Query(None, min_length=3, max_length=22),
event_person_id: str = Query(None, min_length=3, max_length=22),
@@ -382,7 +382,7 @@ async def search_event_badge_obj_li(
# Updated 2022-04-16
@router.get('/event/badge/{event_badge_id}/email_review', response_model=Resp_Body_Base)
async def event_badge_obj_email_review(
event_badge_id: str = Query(..., min_length=11, max_length=22),
event_badge_id: str = Path(min_length=11, max_length=22),
root_url: Optional[str] = Query(None, min_length=10, max_length=100), # Absolute min = 7
# to_email: str = Query(..., min_length=5, max_length=100),
# to_name: str = Query(..., min_length=2, max_length=75),
@@ -403,7 +403,7 @@ async def event_badge_obj_email_review(
# Updated 2022-02-15
@router.get('/event/badge/{event_badge_id}', response_model=Resp_Body_Base)
async def get_event_badge_obj(
event_badge_id: str = Query(..., min_length=11, max_length=22),
event_badge_id: str = Path(min_length=11, max_length=22),
badge_only: bool = False,
inc_event_badge_template: bool = True,
@@ -450,7 +450,7 @@ async def get_event_badge_obj(
# Updated 2021-07-28
@router.get('/account/{account_id}/event/badge/list', response_model=Resp_Body_Base)
async def get_account_obj_event_badge_list(
account_id: str = Query(..., min_length=1, max_length=22),
account_id: str = Path(min_length=11, max_length=22),
limit: int = 500, # For now this covers any included objects or object lists
enabled: str = 'enabled', # For now this covers any included objects or object lists
inc_event_badge: bool = False,
@@ -501,7 +501,7 @@ async def get_account_obj_event_badge_list(
# Updated 2021-07-28
@router.get('/event/{event_id}/event/badge/list', response_model=Resp_Body_Base)
async def get_event_obj_event_badge_list(
event_id: str = Query(..., min_length=11, max_length=22),
event_id: str = Path(min_length=11, max_length=22),
badge_only: bool = False,
badge_type_code: str = None,
printed: str = 'not_printed', # not_printed, printed, all
@@ -550,7 +550,7 @@ async def get_event_obj_event_badge_list(
@router.delete('/event/badge/{obj_id}', response_model=Resp_Body_Base)
async def delete_event_badge_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,
):