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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user