+
+ 404 Not Found
+ Could not find the requested invoice.
+
+ Go Back
+
+
+ );
+}
\ No newline at end of file
diff --git a/app/dashboard/invoices/[id]/edit/page.tsx b/app/dashboard/invoices/[id]/edit/page.tsx
index 72f9a6b..8719078 100644
--- a/app/dashboard/invoices/[id]/edit/page.tsx
+++ b/app/dashboard/invoices/[id]/edit/page.tsx
@@ -1,6 +1,7 @@
import Form from '@/app/ui/invoices/edit-form';
import Breadcrumbs from '@/app/ui/invoices/breadcrumbs';
import {fetchCustomers, fetchInvoiceById} from '@/app/lib/data';
+import { notFound } from 'next/navigation';
export default async function Page({ params }: { params: { id: string } }) {
const id = params.id;
@@ -8,6 +9,10 @@ export default async function Page({ params }: { params: { id: string } }) {
fetchInvoiceById(id),
fetchCustomers(),
]);
+
+ if (!invoice) {
+ notFound();
+ }
return (