Update main.py
Browse files
main.py
CHANGED
|
@@ -232,9 +232,9 @@ async def booking_action(action: str, id: str):
|
|
| 232 |
if action not in ("confirm", "cancel"):
|
| 233 |
raise HTTPException(status_code=400, detail="無效的動作")
|
| 234 |
|
| 235 |
-
status_map = {"confirm": "顧客已確認", "cancel": "顧客已取消"}
|
| 236 |
new_status = status_map[action]
|
| 237 |
-
event = "顧客已確認" if action == "confirm" else "顧客已取消"
|
| 238 |
|
| 239 |
try:
|
| 240 |
res = supabase.table("bookings").update({"status": new_status}).eq("id", id).execute()
|
|
@@ -341,7 +341,7 @@ async def booking_action(action: str, id: str):
|
|
| 341 |
def notify_boss(name, tel, date, time, pax, email="", event="新訂位"):
|
| 342 |
# 1. GAS Email(主要,必送)
|
| 343 |
if BOSS_EMAIL and GAS_MAIL_URL:
|
| 344 |
-
emoji = {"新訂位": "🔔", "顧客已確認": "✅", "顧客已取消": "🚫", "已付訂金": "💰"}.get(event, "📢")
|
| 345 |
subject = f"[{event}] {name} - {date} {time}"
|
| 346 |
html = f"""<div style="font-family:sans-serif; background:#1a1a1a; color:#eee; padding:24px; border-radius:8px;">
|
| 347 |
<h2 style="color:#d4af37; border-bottom:1px solid #444; padding-bottom:12px;">{emoji} Cié Cié Taipei — {event}</h2>
|
|
|
|
| 232 |
if action not in ("confirm", "cancel"):
|
| 233 |
raise HTTPException(status_code=400, detail="無效的動作")
|
| 234 |
|
| 235 |
+
status_map = {"confirm": "網頁顧客已確認", "cancel": "網頁顧客已取消"}
|
| 236 |
new_status = status_map[action]
|
| 237 |
+
event = "網頁顧客已確認" if action == "confirm" else "網頁顧客已取消"
|
| 238 |
|
| 239 |
try:
|
| 240 |
res = supabase.table("bookings").update({"status": new_status}).eq("id", id).execute()
|
|
|
|
| 341 |
def notify_boss(name, tel, date, time, pax, email="", event="新訂位"):
|
| 342 |
# 1. GAS Email(主要,必送)
|
| 343 |
if BOSS_EMAIL and GAS_MAIL_URL:
|
| 344 |
+
emoji = {"新訂位": "🔔", "網頁顧客已確認": "✅", "顧客已取消": "🚫", "已付訂金": "💰"}.get(event, "📢")
|
| 345 |
subject = f"[{event}] {name} - {date} {time}"
|
| 346 |
html = f"""<div style="font-family:sans-serif; background:#1a1a1a; color:#eee; padding:24px; border-radius:8px;">
|
| 347 |
<h2 style="color:#d4af37; border-bottom:1px solid #444; padding-bottom:12px;">{emoji} Cié Cié Taipei — {event}</h2>
|