mirror of
https://github.com/michivonah/nextjs.git
synced 2025-12-22 22:16:28 +01:00
implement error handling
This commit is contained in:
parent
39005d46a5
commit
7d2dea886c
5 changed files with 144 additions and 8 deletions
|
|
@ -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(props: {
|
||||
params: Promise<{
|
||||
|
|
@ -14,6 +15,10 @@ export default async function Page(props: {
|
|||
fetchCustomers(),
|
||||
]);
|
||||
|
||||
if(!invoice){
|
||||
notFound();
|
||||
}
|
||||
|
||||
return (
|
||||
<main>
|
||||
<Breadcrumbs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue