Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -503,12 +503,12 @@ def api_confirm_order():
|
|
| 503 |
new_id = cur.fetchone()[0]
|
| 504 |
conn.commit()
|
| 505 |
|
| 506 |
-
#
|
| 507 |
-
|
|
|
|
| 508 |
global_drafts.pop(table_number, None)
|
| 509 |
-
active_tasks.pop(table_number, None)
|
| 510 |
|
| 511 |
-
return jsonify({"success": True, "message": "سفارش ثبت شد و
|
| 512 |
except Exception as e:
|
| 513 |
conn.rollback()
|
| 514 |
return jsonify({"error": f"خطا در ثبت سفارش: {str(e)}"}), 500
|
|
|
|
| 503 |
new_id = cur.fetchone()[0]
|
| 504 |
conn.commit()
|
| 505 |
|
| 506 |
+
# --- MODIFICATION: Do NOT clear the session so the customer can continue chatting ---
|
| 507 |
+
# The draft is already used, but the chat history remains intact.
|
| 508 |
+
# Remove the draft for this table (a new draft will be created for subsequent orders).
|
| 509 |
global_drafts.pop(table_number, None)
|
|
|
|
| 510 |
|
| 511 |
+
return jsonify({"success": True, "message": "سفارش ثبت شد. میتوانید همچنان با من گفتگو کنید."})
|
| 512 |
except Exception as e:
|
| 513 |
conn.rollback()
|
| 514 |
return jsonify({"error": f"خطا در ثبت سفارش: {str(e)}"}), 500
|