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,6 +1,6 @@
import datetime
#from datetime import datetime, time, timedelta
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_order_cart_obj(
# Update 2021-08-02 (partially)
@router.patch('/{order_cart_id}', response_model=Resp_Body_Base)
async def patch_order_cart_obj(
order_cart_id: str = Query(..., min_length=11, max_length=22),
order_cart_id: str = Path(min_length=11, max_length=22),
order_cart_obj: Order_Cart_Base = None,
repl_order_cart_line_list: Optional[bool] = False, # Replace all the lines instead of trying to update
# was repl_order_cart_line_list # NOTE: It was with out _list, just _li
@@ -204,7 +204,7 @@ async def lookup_order_cart_obj(
# Updated 2021-08-07
@router.get('/{order_cart_id}', response_model=Resp_Body_Base)
async def get_order_cart_obj(
order_cart_id: str = Query(..., min_length=11, max_length=22),
order_cart_id: str = Path(min_length=11, max_length=22),
limit: int = 500,
enabled: str = 'enabled',
inc_order_cart_line_list: bool = False,
@@ -236,7 +236,7 @@ async def get_order_cart_obj(
@router.delete('/{obj_id}', response_model=Resp_Body_Base)
async def delete_order_cart_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,
):