Fix: Refresh page after updating order tracking details

Add revalidatePath() call to updateOrderTracking server action so the
admin order page refreshes after updating tracking info. This ensures
the displayed data matches the database immediately.
This commit is contained in:
Andymick
2026-07-18 20:39:57 +01:00
parent c476f92a66
commit 466f11a866
2 changed files with 6 additions and 2 deletions
+4 -1
View File
@@ -1,6 +1,6 @@
'use server';
import { redirect } from 'next/navigation';
import { redirect, revalidatePath } from 'next/navigation';
import { prisma } from '@/lib/prisma';
const AUTO_ARCHIVE_DAYS = 30;
@@ -55,5 +55,8 @@ export async function updateOrderTracking(formData: FormData) {
},
});
// Revalidate the page to show updated data
revalidatePath(`/admin/orders/${id}`);
// TODO: Send email notification to customer when status changes
}