bookings list

This commit is contained in:
2025-01-30 14:38:53 +08:00
parent 4f3ad4d912
commit ac262169ef
2 changed files with 31 additions and 1 deletions
+2 -1
View File
@@ -96,7 +96,8 @@ def dashboard():
listings = Listing.query.filter_by(host_id=current_user.id).all()
users = User.query.all()
documents = {doc.user_id: doc for doc in Document.query.all()}
return render_template('dashboard.html', listings=listings, users=users, documents=documents)
bookings = Booking.query.join(Listing).filter(Listing.host_id == current_user.id).all()
return render_template('dashboard.html', listings=listings, users=users, documents=documents, bookings=bookings)
return redirect(url_for('home'))
@app.route('/create-listing', methods=['GET', 'POST'])