Skip to content

Commit 4dfa98b

Browse files
author
pedro
authored
Merge pull request #7 from TaleLin/fix-getbooks
修复软删除图书时,图书仍然显示
2 parents 36f607e + 7dd8f87 commit 4dfa98b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/api/v1/book.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def get_book(id):
2626

2727
@book_api.route('/', methods=['GET'])
2828
def get_books():
29-
books = Book.query.filter_by(soft=False).all()
29+
books = Book.query.filter_by(delete_time=None).all()
3030
if books is None or len(books) < 1:
3131
raise NotFound(msg='没有找到相关书籍')
3232
return jsonify(books)

0 commit comments

Comments
 (0)