event&eventaction

This commit is contained in:
2023-10-29 17:16:50 +09:00
parent ead6658455
commit 9cd4c8a5ab
4 changed files with 70 additions and 3 deletions

View File

@@ -183,4 +183,33 @@ async def domain_delete(
db=Depends(get_db),
):
return delete_domain(db, userid,id)
return delete_domain(db, userid,id)
@r.get(
"/events",
response_model=t.List[Event],
response_model_exclude={"id"},
response_model_exclude_none=True,
)
async def event_data(
request: Request,
db=Depends(get_db),
):
events = get_events(db)
return events
@r.get(
"/eventactions/{eventid}",
response_model=t.List[Action],
response_model_exclude={"id"},
response_model_exclude_none=True,
)
async def eventactions_data(
request: Request,
eventid: str,
db=Depends(get_db),
):
actions = get_eventactions(db,eventid)
return actions