Передача сервиса в метод поиска по ид
This commit is contained in:
parent
fea29956d2
commit
72362abaf7
|
@ -212,7 +212,7 @@ def mark_busy_calendar_slot_by_id(
|
||||||
description: str | None = None,
|
description: str | None = None,
|
||||||
service: Resource = Depends(get_calendar_service)
|
service: Resource = Depends(get_calendar_service)
|
||||||
):
|
):
|
||||||
event = get_slot_by_id(slot_id=slot_id)
|
event = get_slot_by_id(slot_id=slot_id, service=service)
|
||||||
|
|
||||||
if event.summary != TITLE_FREE:
|
if event.summary != TITLE_FREE:
|
||||||
raise HTTPException(status_code=status.HTTP_409_CONFLICT, detail="Slot is busy")
|
raise HTTPException(status_code=status.HTTP_409_CONFLICT, detail="Slot is busy")
|
||||||
|
@ -232,7 +232,7 @@ def mark_free_calendar_slot_by_id(
|
||||||
slot_id: str,
|
slot_id: str,
|
||||||
service: Resource = Depends(get_calendar_service)
|
service: Resource = Depends(get_calendar_service)
|
||||||
):
|
):
|
||||||
event = get_slot_by_id(slot_id=slot_id)
|
event = get_slot_by_id(slot_id=slot_id, service=service)
|
||||||
|
|
||||||
event.summary = TITLE_FREE
|
event.summary = TITLE_FREE
|
||||||
event.colorId = COLOR_FREE
|
event.colorId = COLOR_FREE
|
||||||
|
|
Loading…
Reference in New Issue