Slow but steady progress to update all end points...

This commit is contained in:
Scott Idem
2024-04-26 14:17:46 -04:00
parent d3f26f1696
commit b37f14d25c
5 changed files with 26 additions and 26 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
@@ -50,7 +50,7 @@ async def post_account_obj(
@router.patch('/account/{obj_id}', response_model=Resp_Body_Base)
async def patch_account_obj(
obj: Account_Base,
obj_id: str = Query(..., min_length=11, max_length=22),
obj_id: str = Path(..., min_length=11, max_length=22),
return_obj: Optional[bool] = True,
@@ -149,7 +149,7 @@ async def get_account_obj_li(
# Working well as of 2021-06-11. Using as a template for other routes.
@router.get('/account/{account_id}', response_model=Resp_Body_Base)
async def get_account_obj(
account_id: str = Query(..., min_length=11, max_length=22),
account_id: str = Path(..., min_length=11, max_length=22),
inc_account_cfg: bool = False, # Priority l1
inc_address: bool = False, # Under contact
inc_address_list: bool = False,
@@ -324,7 +324,7 @@ async def get_account_obj(
@router.delete('/account/{obj_id}', response_model=Resp_Body_Base)
async def delete_account_obj(
obj_id: str = Query(..., min_length=11, max_length=22),
obj_id: str = Path(..., min_length=11, max_length=22),
commons: Common_Route_Params = Depends(common_route_params),
):
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
@@ -340,7 +340,7 @@ async def delete_account_obj(
@router.get('/account/{account_id}/cfg', response_model=Resp_Body_Base)
async def get_account_cfg_obj(
account_id: str = Query(..., min_length=11, max_length=22),
account_id: str = Path(..., min_length=11, max_length=22),
sys_module: Optional[str] = None, # event, fundraising, membership
commons: Common_Route_Params = Depends(common_route_params),