Work on event list
This commit is contained in:
@@ -96,7 +96,7 @@ app.include_router(
|
|||||||
)
|
)
|
||||||
app.include_router(
|
app.include_router(
|
||||||
event.router,
|
event.router,
|
||||||
prefix='/event',
|
# prefix='/event',
|
||||||
tags=['Event'],
|
tags=['Event'],
|
||||||
)
|
)
|
||||||
app.include_router(
|
app.include_router(
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ from app.models.response_models import Resp_Body_Base, mk_resp
|
|||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
|
|
||||||
@router.post('', response_model=Resp_Body_Base)
|
@router.post('/event', response_model=Resp_Body_Base)
|
||||||
async def post_event_obj(
|
async def post_event_obj(
|
||||||
obj: Event_Base,
|
obj: Event_Base,
|
||||||
x_account_id: str = Header(...),
|
x_account_id: str = Header(...),
|
||||||
@@ -41,7 +41,7 @@ async def post_event_obj(
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
@router.patch('/{obj_id}', response_model=Resp_Body_Base)
|
@router.patch('/event/{obj_id}', response_model=Resp_Body_Base)
|
||||||
async def patch_event_obj(
|
async def patch_event_obj(
|
||||||
obj_id: str = Query(..., min_length=1, max_length=22),
|
obj_id: str = Query(..., min_length=1, max_length=22),
|
||||||
obj: Event_Base = None,
|
obj: Event_Base = None,
|
||||||
@@ -69,7 +69,7 @@ async def patch_event_obj(
|
|||||||
|
|
||||||
|
|
||||||
# ### BEGIN ### API Event ### patch_event_json() ###
|
# ### BEGIN ### API Event ### patch_event_json() ###
|
||||||
@router.patch('/{event_id}/json', response_model=Resp_Body_Base)
|
@router.patch('/event/{event_id}/json', response_model=Resp_Body_Base)
|
||||||
async def patch_event_json(
|
async def patch_event_json(
|
||||||
event_obj: Event_Base,
|
event_obj: Event_Base,
|
||||||
event_id: str = Query(..., min_length=1, max_length=22),
|
event_id: str = Query(..., min_length=1, max_length=22),
|
||||||
@@ -107,7 +107,7 @@ async def patch_event_json(
|
|||||||
# ### END ### API Event ### patch_event_json() ###
|
# ### END ### API Event ### patch_event_json() ###
|
||||||
|
|
||||||
|
|
||||||
# @router.get('/list', response_model=Resp_Body_Base)
|
# @router.get('/event/list', response_model=Resp_Body_Base)
|
||||||
# async def get_event_obj_li(
|
# async def get_event_obj_li(
|
||||||
# for_obj_type: Optional[str] = Query(None, min_length=2, max_length=50),
|
# for_obj_type: Optional[str] = Query(None, min_length=2, max_length=50),
|
||||||
# for_obj_id: Optional[str] = Query(None, min_length=1, max_length=22),
|
# for_obj_id: Optional[str] = Query(None, min_length=1, max_length=22),
|
||||||
@@ -130,7 +130,7 @@ async def patch_event_json(
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@router.get('/list', response_model=Resp_Body_Base)
|
@router.get('/event/list', response_model=Resp_Body_Base)
|
||||||
async def get_event_obj_li(
|
async def get_event_obj_li(
|
||||||
for_obj_type: Optional[str] = Query(None, min_length=2, max_length=50), # account
|
for_obj_type: Optional[str] = Query(None, min_length=2, max_length=50), # account
|
||||||
for_obj_id: Optional[str] = Query(None, min_length=1, max_length=22),
|
for_obj_id: Optional[str] = Query(None, min_length=1, max_length=22),
|
||||||
@@ -251,7 +251,7 @@ async def get_event_obj_li(
|
|||||||
|
|
||||||
# ### BEGIN ### API Event ### get_event_obj() ###
|
# ### BEGIN ### API Event ### get_event_obj() ###
|
||||||
# Working well as of 2021-06-30. Using as a template for other routes.
|
# Working well as of 2021-06-30. Using as a template for other routes.
|
||||||
@router.get('/{event_id}', response_model=Resp_Body_Base)
|
@router.get('/event/{event_id}', response_model=Resp_Body_Base)
|
||||||
async def get_event_obj(
|
async def get_event_obj(
|
||||||
event_id: str = Query(..., min_length=1, max_length=22),
|
event_id: str = Query(..., min_length=1, max_length=22),
|
||||||
enabled: str = 'enabled', # For now this covers any included objects or object lists
|
enabled: str = 'enabled', # For now this covers any included objects or object lists
|
||||||
@@ -407,7 +407,7 @@ async def get_person_event_obj_li(
|
|||||||
# ### END ### API Event Methods ### get_person_event_obj_li() ###
|
# ### END ### API Event Methods ### get_person_event_obj_li() ###
|
||||||
|
|
||||||
|
|
||||||
@router.delete('/{obj_id}', response_model=Resp_Body_Base)
|
@router.delete('/event/{obj_id}', response_model=Resp_Body_Base)
|
||||||
async def delete_event_obj(
|
async def delete_event_obj(
|
||||||
obj_id: str = Query(..., min_length=1, max_length=22),
|
obj_id: str = Query(..., min_length=1, max_length=22),
|
||||||
x_account_id: str = Header(...),
|
x_account_id: str = Header(...),
|
||||||
|
|||||||
Reference in New Issue
Block a user