фикс багов, интеграция с фронтом

This commit is contained in:
55 changed files with 293 additions and 1 deletions

View File

@@ -61,6 +61,10 @@ async def create_schedule(
schedule_data = schedule_in.model_dump()
schedule_data["user_id"] = current_user.id
schedule = await crud_schedule.create(db, schedule_data)
# Перезагрузить расписание с tasks для корректной сериализации
schedule = await crud_schedule.get_with_tasks(db, schedule.id)
return schedule
@@ -86,6 +90,10 @@ async def update_schedule(
update_data = schedule_in.model_dump(exclude_unset=True)
schedule = await crud_schedule.update(db, schedule, update_data)
# Перезагрузить расписание с tasks для корректной сериализации
schedule = await crud_schedule.get_with_tasks(db, schedule.id)
return schedule