hmm
This commit is contained in:
@@ -75,8 +75,13 @@ export default function OrderNotifications() {
|
||||
|
||||
const checkForNewOrders = async () => {
|
||||
try {
|
||||
// Fetch orders from the last 24 hours that are in paid status
|
||||
const orderData = await clientFetch("/orders?status=paid&limit=10");
|
||||
// Get orders from the last 24 hours with a more efficient query
|
||||
const yesterday = new Date();
|
||||
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}`);
|
||||
const orders: Order[] = orderData.orders || [];
|
||||
|
||||
// If this is the first fetch, just store the orders without notifications
|
||||
|
||||
@@ -102,8 +102,13 @@ export default function UnifiedNotifications() {
|
||||
|
||||
const checkForNewOrders = async () => {
|
||||
try {
|
||||
// Fetch orders from the last 24 hours that are in paid status
|
||||
const orderData = await clientFetch("/orders?status=paid&limit=10");
|
||||
// Get orders from the last 24 hours with a more efficient query
|
||||
const yesterday = new Date();
|
||||
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}`);
|
||||
const orders: Order[] = orderData.orders || [];
|
||||
|
||||
// If this is the first fetch, just store the orders without notifications
|
||||
|
||||
Reference in New Issue
Block a user