diff --git a/back/api.py b/back/api.py index a141288..b515fdb 100644 --- a/back/api.py +++ b/back/api.py @@ -22,9 +22,8 @@ import shutil import os from .db import Base, engine, SessionLocal, database, Session -from .service import add_poems_to_db, generate_poem, check_obsolete, get_query_results from .scheduler import app as app_rocketry -from . import schemas, models, utils +from . import schemas, models, utils, service Base.metadata.create_all(bind=engine) @@ -112,7 +111,7 @@ def delete_from_db(announcement: schemas.DelAnnouncement, db: Annotated[Session, # Забронировать объявление @app.post("/api/book") def change_book_status(data: schemas.Book, current_user: Annotated[schemas.User, Depends(utils.get_current_user)], - db: Annotated[Session, Depends(utils.get_db)], db: Annotated[Session, Depends(utils.get_db)]): + db: Annotated[Session, Depends(utils.get_db)]): # Находим объявление по данному id announcement_to_change = db.query(models.Announcement).filter(models.Announcement.id == data.id).first() # Проверяем, что объявление с данным id существует