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, os, pathlib, 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 fastapi.responses import FileResponse, StreamingResponse
from pydantic import BaseModel, EmailStr, Field
from typing import Dict, List, Optional, Set, Union
@@ -51,7 +51,7 @@ async def post_event_file_obj(
@router.post('/event/file/from_hosted_file/{hosted_file_id}', response_model=Resp_Body_Base)
async def create_from_hosted_file(
event_file_obj: Event_File_Base,
hosted_file_id: str = Query(..., min_length=11, max_length=22),
hosted_file_id: str = Path(min_length=11, max_length=22),
inc_hosted_file: bool = False,
return_obj: bool = True,
commons: Common_Route_Params = Depends(common_route_params),
@@ -152,7 +152,7 @@ async def create_from_hosted_file(
@router.patch('/event/file/{obj_id}', response_model=Resp_Body_Base)
async def patch_event_file_obj(
obj_id: str = Query(..., min_length=11, max_length=22),
obj_id: str = Path(min_length=11, max_length=22),
obj: Event_File_Base = None,
x_account_id: Optional[str] = Header(..., ),
return_obj: Optional[bool] = True,
@@ -307,7 +307,7 @@ async def download_event_file(
# Updated 2021-10-21
@router.get('/event/file/{event_file_id}', response_model=Resp_Body_Base)
async def get_event_file_obj(
event_file_id: str = Query(..., min_length=11, max_length=22),
event_file_id: str = Path(min_length=11, max_length=22),
inc_hosted_file: bool = False,
enabled: str = 'enabled', # enabled, disabled, all; For now this covers any included objects or object lists
hidden: str = 'not_hidden', # hidden, not_hidden, all
@@ -344,7 +344,7 @@ async def get_event_file_obj(
# Updated 2021-11-02
@router.delete('/event/file/{event_file_id}', response_model=Resp_Body_Base)
async def delete_event_file_obj(
event_file_id: str = Query(..., min_length=11, max_length=22),
event_file_id: str = Path(min_length=11, max_length=22),
hosted_file_id: str = Query(..., min_length=11, max_length=22),
for_type: str = Query(..., min_length=1, max_length=25),
for_id: str = Query(..., min_length=11, max_length=22),