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
@@ -45,7 +45,7 @@ async def post_contact_obj(
@router.patch('/{obj_id}', response_model=Resp_Body_Base)
async def patch_contact_obj(
obj: Contact_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,
@@ -126,7 +126,7 @@ async def post_contact_obj_new_v4(
@router.patch('/{contact_id}/exist_v4', response_model=Resp_Body_Base)
async def patch_contact_obj_exist_v4(
contact_obj: Contact_Base,
contact_id: str = Query(..., min_length=11, max_length=22),
contact_id: str = Path(min_length=11, max_length=22),
for_type: str = None,
for_id: str = None,
create_sub_obj: bool = False,
@@ -178,7 +178,7 @@ async def patch_contact_obj_exist_v4(
@router.patch('/{contact_id}/json', response_model=Resp_Body_Base)
async def patch_contact_json(
contact_obj: Contact_Base,
contact_id: str = Query(..., min_length=1, max_length=22),
contact_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,
@@ -279,7 +279,7 @@ async def get_contact_obj_li(
@router.get('/{obj_id}', response_model=Resp_Body_Base)
async def get_contact_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(...),
by_alias: Optional[bool] = True,
exclude_unset: Optional[bool] = True,
@@ -300,7 +300,7 @@ async def get_contact_obj(
@router.delete('/{obj_id}', response_model=Resp_Body_Base)
async def delete_contact_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,
):