Saving current progress with change from using Query() to Path()
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -45,7 +45,7 @@ async def post_event_presenter_obj(
|
||||
@router.patch('/{obj_id}', response_model=Resp_Body_Base)
|
||||
async def patch_event_presenter_obj(
|
||||
obj: Event_Presenter_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,
|
||||
@@ -215,7 +215,7 @@ async def get_event_presenter_obj_li(
|
||||
|
||||
# @router.get('/{obj_id}', response_model=Resp_Body_Base)
|
||||
# async def get_event_presenter_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,
|
||||
@@ -237,7 +237,7 @@ async def get_event_presenter_obj_li(
|
||||
# Working well as of 2021-06-07. Using as a template for other routes.
|
||||
@router.get('/{event_presenter_id}', response_model=Resp_Body_Base)
|
||||
async def get_event_presenter_obj(
|
||||
event_presenter_id: str = Query(..., min_length=11, max_length=22),
|
||||
event_presenter_id: str = Path(min_length=11, max_length=22),
|
||||
enabled: str = 'enabled', # enabled, disabled, all; For now this covers any included objects or object lists
|
||||
hidden: str = 'not_hidden', # hidden, not_hidden, all
|
||||
inc_file_count: bool = False,
|
||||
@@ -303,7 +303,7 @@ async def get_event_presenter_obj(
|
||||
|
||||
@router.delete('/{obj_id}', response_model=Resp_Body_Base)
|
||||
async def delete_event_presenter_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,
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user