This commit is contained in:
NotII
2025-03-23 23:08:09 +00:00
parent 259898cef0
commit 64ee9b842e
4 changed files with 46 additions and 71 deletions

View File

@@ -80,8 +80,9 @@ export default function OrderNotifications() {
yesterday.setDate(yesterday.getDate() - 1);
const timestamp = yesterday.toISOString();
// Include timestamp filter to reduce load
const orderData = await clientFetch(`/orders?status=paid&limit=10&after=${timestamp}`);
// Use orderDate parameter instead of 'after' to avoid backend casting errors
// The error logs show that the 'after' parameter is being interpreted as 'orderId' incorrectly
const orderData = await clientFetch(`/orders?status=paid&limit=10&orderDate[gte]=${timestamp}`);
const orders: Order[] = orderData.orders || [];
// If this is the first fetch, just store the orders without notifications