diff --git a/app/dashboard/(overview)/page.tsx b/app/dashboard/(overview)/page.tsx index 13acd308..87ddcd44 100644 --- a/app/dashboard/(overview)/page.tsx +++ b/app/dashboard/(overview)/page.tsx @@ -10,6 +10,8 @@ import { RevenueChartSkeleton, } from "@/app/ui/skeletons"; +export const dynamic = "force-dynamic"; + export const metadata: Metadata = { title: "Dashboard", }; diff --git a/app/dashboard/customers/page.tsx b/app/dashboard/customers/page.tsx index 60071ea9..91027ed0 100644 --- a/app/dashboard/customers/page.tsx +++ b/app/dashboard/customers/page.tsx @@ -1,9 +1,9 @@ -export default function Page() { - return

Customers Page

; -} - import type { Metadata } from "next"; export const metadata: Metadata = { title: "Customers", }; + +export default function Page() { + return

Customers Page

; +} diff --git a/app/dashboard/invoices/create/page.tsx b/app/dashboard/invoices/create/page.tsx index 160ddff3..c2bf07eb 100644 --- a/app/dashboard/invoices/create/page.tsx +++ b/app/dashboard/invoices/create/page.tsx @@ -3,6 +3,8 @@ import { fetchCustomers } from "@/app/lib/data"; import Breadcrumbs from "@/app/ui/invoices/breadcrumbs"; import Form from "@/app/ui/invoices/create-form"; +export const dynamic = "force-dynamic"; + export const metadata: Metadata = { title: "Create invoices", }; diff --git a/app/dashboard/invoices/page.tsx b/app/dashboard/invoices/page.tsx index 5516268a..0efe5521 100644 --- a/app/dashboard/invoices/page.tsx +++ b/app/dashboard/invoices/page.tsx @@ -8,6 +8,8 @@ import Table from "@/app/ui/invoices/table"; import Search from "@/app/ui/search"; import { InvoicesTableSkeleton } from "@/app/ui/skeletons"; +export const dynamic = "force-dynamic"; + export const metadata: Metadata = { title: "Invoices", }; diff --git a/app/lib/actions.ts b/app/lib/actions.ts index f08093f1..35bfbf0f 100644 --- a/app/lib/actions.ts +++ b/app/lib/actions.ts @@ -103,7 +103,7 @@ export async function updateInvoice( redirect("/dashboard/invoices"); } -export async function deleteInvoice(id: string) { +export async function deleteInvoice(id: string): Promise { // throw new Error('Failed to Delete Invoice. ') try { await sql` @@ -111,11 +111,8 @@ export async function deleteInvoice(id: string) { WHERE id = ${id} `; revalidatePath("/dashboard/invoices"); - return { message: "Deleted Invoice. " }; } catch (_error) { - return { - message: "Database Error: Failed while deleting record from Invoice. ", - }; + console.error("Database Error: Failed while deleting record from Invoice."); } }