mirror of
https://github.com/michivonah/nextjs.git
synced 2025-12-22 22:16:28 +01:00
implement form actions for invoices + docs
This commit is contained in:
parent
364f73b06a
commit
39005d46a5
7 changed files with 240 additions and 20 deletions
|
|
@ -0,0 +1,28 @@
|
|||
import Form from '@/app/ui/invoices/edit-form';
|
||||
import Breadcrumbs from '@/app/ui/invoices/breadcrumbs';
|
||||
import { fetchCustomers, fetchInvoiceById } from '@/app/lib/data';
|
||||
|
||||
export default async function Page(props: {
|
||||
params: Promise<{
|
||||
id: string
|
||||
}>
|
||||
}){
|
||||
const params = await props.params;
|
||||
const id = params.id;
|
||||
const [invoice, customers] = await Promise.all([
|
||||
fetchInvoiceById(id),
|
||||
fetchCustomers(),
|
||||
]);
|
||||
|
||||
return (
|
||||
<main>
|
||||
<Breadcrumbs
|
||||
breadcrumbs={[
|
||||
{ label: 'Invoices', href: '/dashboard/invoices'},
|
||||
{ label: 'Edit Invoice', href: `/dashboard/invoices/${id}/edit`, active: true, },
|
||||
]}
|
||||
/>
|
||||
<Form invoice={invoice} customers={customers} />
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue