camparchimedes commited on
Commit
aa6c59a
ยท
verified ยท
1 Parent(s): 2fe5694

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -2
app.py CHANGED
@@ -147,7 +147,7 @@ async def handle_message(message: cl.Message):
147
  payload = {"booking_id": bestillingskode}
148
 
149
  try:
150
- # --async POST request
151
  response = await async_post_request(API_URL, headers, payload)
152
  response.raise_for_status()
153
  booking_data = response.json()
@@ -158,7 +158,29 @@ async def handle_message(message: cl.Message):
158
  if "error" in booking_data:
159
  raise APIResponseError(booking_data["error"])
160
 
161
- # --markdown_table
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  table = (
163
  "| ๐‘ญ๐’Š๐’†๐’๐’… | ๐—œ๐—ป๐—ณ๐—ผ |\n"
164
  "|:-----------|:---------------------|\n"
 
147
  payload = {"booking_id": bestillingskode}
148
 
149
  try:
150
+
151
  response = await async_post_request(API_URL, headers, payload)
152
  response.raise_for_status()
153
  booking_data = response.json()
 
158
  if "error" in booking_data:
159
  raise APIResponseError(booking_data["error"])
160
 
161
+ #table = (
162
+ #"| ๐‘ญ๐’Š๐’†๐’๐’… | ๐—œ๐—ป๐—ณ๐—ผ |\n"
163
+ #"|:----------------|:-------------------------------------------|\n"
164
+ #f"| ๐™Š๐™ง๐™™๐™š๐™ง ๐™‰๐™ช๐™ข๐™—๐™š๐™ง | {booking_data.get('order_number', 'N/A')} |\n"
165
+ #f"| ๐˜ผ๐™˜๐™˜๐™š๐™ฅ๐™ฉ๐™š๐™™ | {booking_data.get('accepted', 'N/A')} |\n"
166
+ #f"| ๐™‚๐™ช๐™š๐™จ๐™ฉ๐™จ | {booking_data.get('guests', 'N/A')} |\n"
167
+ #f"| ๐™๐™ž๐™ข๐™š ๐™๐™ง๐™ค๐™ข | {booking_data.get('time_from', 'N/A')} |\n"
168
+ #f"| ๐™๐™ž๐™ข๐™š ๐™๐™ค | {booking_data.get('time_to', 'N/A')} |\n"
169
+ #f"| ๐˜พ๐™–๐™ฃ๐™˜๐™š๐™ก๐™ก๐™š๐™™ | {'Yes' if booking_data.get('cancelled', 0) else 'No'} |\n"
170
+ #f"| ๐˜ฟ๐™š๐™จ๐™˜๐™ง๐™ž๐™ฅ๐™ฉ๐™ž๐™ค๐™ฃ | {booking_data.get('description', 'N/A')} |\n"
171
+ #f"| ๐˜ผ๐™ง๐™ง๐™ž๐™ซ๐™–๐™ก | {booking_data.get('arrival', 'N/A')} |\n"
172
+ #f"| ๐˜ฟ๐™š๐™ฅ๐™–๐™ง๐™ฉ๐™ช๐™ง๐™š | {booking_data.get('departure', 'N/A')} |\n"
173
+ #f"| ๐˜ฝ๐™š๐™™๐™™๐™ž๐™ฃ๐™œ | {booking_data.get('bedding', 'N/A')} |\n"
174
+ #f"| ๐™‡๐™ค๐™˜๐™–๐™ฉ๐™ž๐™ค๐™ฃ | Lat: {booking_data.get('lat', 'N/A')}, Long: {booking_data.get('long', 'N/A')} |\n"
175
+ #f"| ๐™‰๐™–๐™ข๐™š | {booking_data.get('name', 'N/A')} |\n"
176
+ #f"| ๐˜พ๐™ค๐™ฃ๐™ฉ๐™–๐™˜๐™ฉ ๐™‰๐™–๐™ข๐™š | {booking_data.get('contactname', 'N/A')} |\n"
177
+ #f"| ๐˜พ๐™ค๐™ฃ๐™ฉ๐™–๐™˜๐™ฉ ๐™€๐™ข๐™–๐™ž๐™ก| {booking_data.get('contactemail', 'N/A')} |\n"
178
+ #f"| ๐˜พ๐™ค๐™ฃ๐™ฉ๐™–๐™˜๐™ฉ ๐™‹๐™๐™ค๐™ฃ๐™š| {booking_data.get('contactphone', 'N/A')} |\n"
179
+ #f"| ๐˜พ๐™ค๐™ช๐™ฃ๐™ฉ๐™ง๐™ฎ ๐˜พ๐™ค๐™™๐™š | {booking_data.get('country_code', 'N/A')} |\n"
180
+ #)
181
+ #combined_message = f"### Informasjon om booking:\n\n{table}"
182
+ #await cl.Message(content=combined_message).send()
183
+
184
  table = (
185
  "| ๐‘ญ๐’Š๐’†๐’๐’… | ๐—œ๐—ป๐—ณ๐—ผ |\n"
186
  "|:-----------|:---------------------|\n"