Saving current progress with change from using Query() to Path()
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import datetime, pytz, 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
|
||||
|
||||
@@ -77,7 +77,7 @@ async def post_event_device_obj(
|
||||
@router.patch('/event/device/{event_device_id}', response_model=Resp_Body_Base)
|
||||
async def patch_event_device_obj(
|
||||
event_device_obj: Event_Device_Base,
|
||||
event_device_id: str = Query(..., min_length=11, max_length=22),
|
||||
event_device_id: str = Path(min_length=11, max_length=22),
|
||||
event_id: str = Query(None, min_length=11, max_length=22),
|
||||
event_location_id: str = Query(None, min_length=11, max_length=22),
|
||||
|
||||
@@ -134,7 +134,7 @@ async def patch_event_device_obj(
|
||||
# Updated 2022-03-09
|
||||
@router.get('/event/device/{event_device_id}', response_model=Resp_Body_Base)
|
||||
async def get_event_device_obj(
|
||||
event_device_id: str = Query(..., min_length=11, max_length=22),
|
||||
event_device_id: str = Path(min_length=11, max_length=22),
|
||||
|
||||
inc_event_cfg: bool = False,
|
||||
inc_event_location: bool = False,
|
||||
@@ -171,7 +171,7 @@ async def get_event_device_obj(
|
||||
# Updated 2022-03-09
|
||||
@router.get('/event/{event_id}/device/list', response_model=Resp_Body_Base)
|
||||
async def get_event_obj_device_list(
|
||||
event_id: str = Query(..., min_length=11, max_length=22),
|
||||
event_id: str = Path(min_length=11, max_length=22),
|
||||
inc_event_cfg: bool = False,
|
||||
inc_event_location: bool = False,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user