LohithGummi commited on
Commit
0523f52
·
verified ·
1 Parent(s): 6b2d5cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -201,6 +201,7 @@ def cancel_order(order_id, customer_id):
201
  cursor.execute(query_refund, (order_id, cancel_fee, refund_amount))
202
 
203
  connection.commit()
 
204
  log_action("cancel_order", details) # Log the cancellation
205
 
206
  query = """select * from refund where order_id = ?;"""
@@ -217,7 +218,7 @@ def cancel_order(order_id, customer_id):
217
  connection.close()
218
 
219
 
220
-
221
  def change_address(order_id, new_address):
222
  """
223
  Updates the shipping address for a specific order in the database.
@@ -251,6 +252,8 @@ def change_address(order_id, new_address):
251
 
252
  query = """select shipping_address from shipping where order_id = ?;"""
253
  cursor.execute(query,(order_id,))
 
 
254
  st.write(f"Updated details: {cursor.fetchall()}")
255
 
256
  return f"Update successful for Order ID {order_id} with new address: {new_address}"
 
201
  cursor.execute(query_refund, (order_id, cancel_fee, refund_amount))
202
 
203
  connection.commit()
204
+
205
  log_action("cancel_order", details) # Log the cancellation
206
 
207
  query = """select * from refund where order_id = ?;"""
 
218
  connection.close()
219
 
220
 
221
+ @tool
222
  def change_address(order_id, new_address):
223
  """
224
  Updates the shipping address for a specific order in the database.
 
252
 
253
  query = """select shipping_address from shipping where order_id = ?;"""
254
  cursor.execute(query,(order_id,))
255
+
256
+ log_action("change_address",details)
257
  st.write(f"Updated details: {cursor.fetchall()}")
258
 
259
  return f"Update successful for Order ID {order_id} with new address: {new_address}"