|
|
@@ -261,7 +261,7 @@ async function handleGetOrder(args: Record<string, any>): Promise<ToolCallResult
|
|
|
try {
|
|
|
// Search for order by innerId (customer-visible order number)
|
|
|
// The order_id parameter is actually the innerId from the customer's perspective
|
|
|
- const response = await fetchOrders(shop_id, 1, 1, { innerId: order_id });
|
|
|
+ const response = await fetchOrders(shop_id, 0, 1, { innerId: order_id });
|
|
|
const orders = Array.isArray(response) ? response : (response.data || response.orders || []);
|
|
|
|
|
|
if (orders.length === 0) {
|
|
|
@@ -375,11 +375,11 @@ async function handleListOrders(args: Record<string, any>): Promise<ToolCallResu
|
|
|
// If filtering by customer name, we need to fetch and filter locally
|
|
|
// because ShopRenter doesn't support name filtering directly
|
|
|
filters.customer_name = customer_name;
|
|
|
- const response = await fetchOrders(shop_id, 1, actualLimit, filters);
|
|
|
+ const response = await fetchOrders(shop_id, 0, actualLimit, filters);
|
|
|
orders = Array.isArray(response) ? response : (response.data || response.orders || []);
|
|
|
} else {
|
|
|
// Direct API fetch with filters
|
|
|
- const response = await fetchOrders(shop_id, 1, actualLimit, filters);
|
|
|
+ const response = await fetchOrders(shop_id, 0, actualLimit, filters);
|
|
|
orders = Array.isArray(response) ? response : (response.data || response.orders || []);
|
|
|
}
|
|
|
|
|
|
@@ -467,7 +467,7 @@ async function handleGetCustomer(args: Record<string, any>): Promise<ToolCallRes
|
|
|
|
|
|
try {
|
|
|
// Fetch customer by email from ShopRenter API
|
|
|
- const response = await fetchCustomers(shop_id, 1, 1, { email });
|
|
|
+ const response = await fetchCustomers(shop_id, 0, 1, { email });
|
|
|
const customers = Array.isArray(response) ? response : (response.data || response.customers || []);
|
|
|
|
|
|
if (customers.length === 0) {
|