latapp 10 месяцев назад
Родитель
Сommit
f21191e1ff
2 измененных файлов с 3 добавлено и 3 удалено
  1. 2 2
      main.py
  2. 1 1
      public/js/app.js

+ 2 - 2
main.py

@@ -91,7 +91,7 @@ class ItemWeb(BaseModel):
     itemTotal: float
 
 class OrderWeb(BaseModel):
-    user: str
+    customer: str
     items: List[ItemWeb]
     totalAmount: float
     orderDate: str
@@ -192,7 +192,7 @@ async def printer_order(order: OrderWeb):
     items = order.items
     table = order.table
     printer = PrinterUSB(0xfe6,0x811e)
-    print_order = Order(order.user,[Item(item.name, item.price, item.quantity) for item in items])
+    print_order = Order(order.customer,[Item(item.name, item.price, item.quantity) for item in items])
     printer.print_order(print_order, table)
 
 

+ 1 - 1
public/js/app.js

@@ -81,7 +81,7 @@ async function processOrder() {
 
     try {
         const orderData = {
-            user: userName,
+            customer: userName,
             table: userTable,
             items: cart.map(item => ({ id: item.id, name: item.name, quantity: item.quantity, price: item.price, itemTotal: item.price * item.quantity })),
             totalAmount: cart.reduce((sum, item) => sum + item.price * item.quantity, 0),