add organizers

This commit is contained in:
Valentin CZERYBA 2023-11-16 21:40:49 +01:00
parent e7e4326a31
commit d621977955
2 changed files with 3 additions and 0 deletions

View File

@ -27,6 +27,7 @@ class EventIn(BaseModel):
name: str
place: str
status: int = 0
organizers: list[str] = []
start_date: datetime | None = None
end_date: datetime | None = None

View File

@ -158,6 +158,7 @@ async def update_events(authorize: Annotated[bool, Depends(permissions_checker.P
event = events.Event(name=eventSingle.name, place=eventSingle.place)
event.start_date = eventSingle.start_date
event.end_date = eventSingle.end_date
event.organizers = eventSingle.organizers
event.created_at = datetime.today()
event_repository.save(event)
content = {"message": "event is created"}
@ -185,6 +186,7 @@ async def update_events_id(item_id: str, authorize: Annotated[bool, Depends(perm
event.place = eventSingle.place
event.start_date = eventSingle.start_date
event.end_date = eventSingle.end_date
event.organizers = eventSingle.organizers
event.updated_at = datetime.today()
event_repository.save(event)
content = {"message": "event is updated"}