diff --git a/app.py b/app.py index 18cdb0c..6b7d42d 100644 --- a/app.py +++ b/app.py @@ -73,31 +73,6 @@ def addItem(): print(msg) return redirect(url_for('root')) -@app.route("/remove") -def remove(): - with sqlite3.connect('database.db') as conn: - cur = conn.cursor() - cur.execute('SELECT productId, name, price, description, image, stock FROM products') - data = cur.fetchall() - conn.close() - return render_template('remove.html', data=data) - -@app.route("/removeItem") -def removeItem(): - productId = request.args.get('productId') - with sqlite3.connect('database.db') as conn: - try: - cur = conn.cursor() - cur.execute('DELETE FROM products WHERE productID = ?', (productId, )) - conn.commit() - msg = "Deleted successsfully" - except: - conn.rollback() - msg = "Error occured" - conn.close() - print(msg) - return redirect(url_for('root')) - @app.route("/displayCategory") def displayCategory(): loggedIn, firstName, noOfItems = getLoginDetails() @@ -338,5 +313,6 @@ def parse(data): ans.append(curr) return ans + if __name__ == '__main__': app.run(debug=True) \ No newline at end of file diff --git a/database.db b/database.db index e8ba566..cd4eb08 100644 Binary files a/database.db and b/database.db differ