small changes

This commit is contained in:
DmitryGantimurov 2023-08-11 15:02:49 +03:00
parent 9a9ade6145
commit 07dfc1606c

@ -114,7 +114,7 @@ def delete_from_db(announcement: schemas.DelAnnouncement, db: Annotated[Session,
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)]):
# Находим объявление по данному id
announcement_to_change = db.query(models.Announcement).filter(Announcement.id == data.id).first()
announcement_to_change = db.query(models.Announcement).filter(models.Announcement.id == data.id).first()
# Проверяем, что объявление с данным id существует
if not announcement_to_change:
raise HTTPException(status_code=404, detail="Item not found")