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
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
@@ -139,7 +139,7 @@ async def patch_membership_person_obj(
# Updated 2022-01-11
@router.get('/membership/person/{membership_person_id}', response_model=Resp_Body_Base)
async def get_membership_person_obj(
membership_person_id: str = Query(..., min_length=11, max_length=22),
membership_person_id: str = Path(min_length=11, max_length=22),
# inc_address: bool = False, # Per member
# inc_contact: bool = False, # Per member
inc_membership_cfg: bool = False,
@@ -206,7 +206,7 @@ async def get_membership_person_obj(
# Updated 2022-01-11
@router.get('/person/{person_id}/membership/person', response_model=Resp_Body_Base)
async def get_person_obj_membership_person(
person_id: str = Query(..., min_length=11, max_length=22),
person_id: str = Path(min_length=11, max_length=22),
# inc_address: bool = False, # Per member
# inc_contact: bool = False, # Per member
inc_membership_cfg: bool = False,
@@ -425,7 +425,7 @@ async def lookup_membership_person_obj(
@router.delete('/membership/person/{obj_id}', response_model=Resp_Body_Base)
async def delete_membership_person_obj(
obj_id: str = Query(..., min_length=1, max_length=22),
obj_id: str = Path(min_length=11, max_length=22),
response: Response = Response,
):
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL