Skip to content

Commit

Permalink
feat: actual booking
Browse files Browse the repository at this point in the history
  • Loading branch information
NickNaskida committed Oct 4, 2023
1 parent 96935de commit 2ded694
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ dist-ssr
*.njsproj
*.sln
*.sw?

.env
4 changes: 3 additions & 1 deletion server/src/api/endpoints/booking.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ async def book_venue(venue_id: int, request: Request):
query_id = web_app_init_data.query_id

# Answer web app query
confirm_message = f"Booking successful! 🎉\n\nDetails:\nVenue: {db_obj.venue.name}\nAddress: {db_obj.venue.address}, {db_obj.venue.city}\nUnder name: {db_obj.under_name}\nDate: {db_obj.date}\nComment: {db_obj.comment}"

try:
await bot.answer_web_app_query(
web_app_query_id=query_id,
Expand All @@ -61,7 +63,7 @@ async def book_venue(venue_id: int, request: Request):
id=query_id,
title="Booking successful!",
input_message_content=InputTextMessageContent(
message_text="Booking successful!"
message_text=confirm_message
)
)
)
Expand Down
4 changes: 2 additions & 2 deletions server/src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class BaseSettings:
SECRET_KEY = secrets.token_urlsafe(32)

BOT_TOKEN = "6564109746:AAELai-cCPlj8_Rr7b_6ADpUE8KtOxkSnxA"
FRONT_BASE_URL = "https://dd94-188-121-217-243.ngrok-free.app"
BACK_BASE_URL = "https://4f3f-188-121-217-243.ngrok-free.app"
FRONT_BASE_URL = "https://ba79-188-121-217-243.ngrok-free.app"
BACK_BASE_URL = "https://382d-188-121-217-243.ngrok-free.app"

SQLALCHEMY_DATABASE_URI = 'sqlite+aiosqlite:///' + os.path.join(BASE_DIR, 'db.sqlite')
SQLALCHEMY_TRACK_MODIFICATIONS = False
Expand Down

0 comments on commit 2ded694

Please sign in to comment.