add organizers
This commit is contained in:
parent
e7e4326a31
commit
d621977955
@ -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
|
||||
|
||||
|
@ -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"}
|
||||
|
Loading…
x
Reference in New Issue
Block a user