Beispiel #1
0
def delete_book(book_id):
    form = LibrForm()
    error = ""
    book = books.delete(book_id - 1)
    books.save_all()
    if not book:
        abort(404)

    return render_template("books_index.html",
                           form=form,
                           books=books.all(),
                           error=error)
Beispiel #2
0
def delete_book(book_id):
    result = books.delete(book_id)
    if not result:
        abort(404)
    return jsonify({'result': result})