camparchimedes commited on
Commit
b2ff696
·
verified ·
1 Parent(s): eadc6c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -2
app.py CHANGED
@@ -171,7 +171,23 @@ async def handle_message(message: cl.Message):
171
  if response:
172
  try:
173
  booking_data = json.loads(response)
174
- table = "| Field | Information |\n|---|---|\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
 
176
  fields_mapping = [
177
  ('booking_id', 'booking_id'),
@@ -188,7 +204,8 @@ async def handle_message(message: cl.Message):
188
  for field, display_name in fields_mapping:
189
  value = booking_data.get(field)
190
  table += f"| {display_name} | {value} |\n"
191
-
 
192
  await cl.Message(content=table).send()
193
 
194
  except Exception as e:
 
171
  if response:
172
  try:
173
  booking_data = json.loads(response)
174
+
175
+
176
+ table = (
177
+ "|:------|:------|\n"
178
+ f"| Booking ID | `{booking_info.get('booking_id')}` |\n"
179
+ f"| Full Name | `{booking_info.get('full_name')}` |\n"
180
+ f"| Amount | `{booking_info.get('amount')} kr` |\n"
181
+ f"| Check-in | `{booking_info.get('checkin')}` |\n"
182
+ f"| Check-out | `{booking_info.get('checkout')}` |\n"
183
+ f"| Address | `{booking_info.get('address')}` |\n"
184
+ f"| User ID | `{booking_info.get('user_id')}` |\n"
185
+ f"| Info Text | `{booking_info.get('infotext')}` |\n"
186
+ f"| Included | `{booking_info.get('included')}` |"
187
+ )
188
+
189
+ """
190
+ table = "| Field | Information |\n|---|---|\n"
191
 
192
  fields_mapping = [
193
  ('booking_id', 'booking_id'),
 
204
  for field, display_name in fields_mapping:
205
  value = booking_data.get(field)
206
  table += f"| {display_name} | {value} |\n"
207
+ """
208
+
209
  await cl.Message(content=table).send()
210
 
211
  except Exception as e: