diff --git a/dashboard/starter-example/app/lib/data.ts b/dashboard/starter-example/app/lib/data.ts index 6704fe9..c9009d0 100644 --- a/dashboard/starter-example/app/lib/data.ts +++ b/dashboard/starter-example/app/lib/data.ts @@ -9,12 +9,11 @@ import { Revenue, } from './definitions'; import { formatCurrency } from './utils'; -import { unstable_noStore as noStore } from 'next/cache'; export async function fetchRevenue() { // Add noStore() here prevent the response from being cached. // This is equivalent to in fetch(..., {cache: 'no-store'}). - noStore(); + try { // Artificially delay a reponse for demo purposes. // Don't do this in real life :) @@ -34,7 +33,6 @@ export async function fetchRevenue() { } export async function fetchLatestInvoices() { - noStore(); try { const data = await sql` SELECT invoices.amount, customers.name, customers.image_url, customers.email, invoices.id @@ -55,7 +53,6 @@ export async function fetchLatestInvoices() { } export async function fetchCardData() { - noStore(); try { // You can probably combine these into a single SQL query // However, we are intentionally splitting them to demonstrate @@ -95,7 +92,6 @@ export async function fetchFilteredInvoices( query: string, currentPage: number, ) { - noStore(); const offset = (currentPage - 1) * ITEMS_PER_PAGE; try { @@ -128,7 +124,6 @@ export async function fetchFilteredInvoices( } export async function fetchInvoicesPages(query: string) { - noStore(); try { const count = await sql`SELECT COUNT(*) FROM invoices @@ -193,7 +188,6 @@ export async function fetchCustomers() { } export async function fetchFilteredCustomers(query: string) { - noStore(); try { const data = await sql` SELECT diff --git a/dashboard/starter-example/app/ui/dashboard/nav-links.tsx b/dashboard/starter-example/app/ui/dashboard/nav-links.tsx index 338b1c5..f2a67eb 100644 --- a/dashboard/starter-example/app/ui/dashboard/nav-links.tsx +++ b/dashboard/starter-example/app/ui/dashboard/nav-links.tsx @@ -1,12 +1,8 @@ -'use client'; - import { UserGroupIcon, HomeIcon, DocumentDuplicateIcon, } from '@heroicons/react/24/outline'; -import Link from 'next/link'; -import { usePathname } from 'next/navigation'; import clsx from 'clsx'; // Map of links to display in the side navigation. @@ -22,26 +18,21 @@ const links = [ ]; export default function NavLinks() { - const pathname = usePathname(); - return ( <> {links.map((link) => { const LinkIcon = link.icon; return ( -

{link.name}

- + ); })} diff --git a/dashboard/starter-example/package.json b/dashboard/starter-example/package.json index d7e788c..988965a 100644 --- a/dashboard/starter-example/package.json +++ b/dashboard/starter-example/package.json @@ -3,7 +3,6 @@ "scripts": { "build": "next build", "dev": "next dev", - "seed": "node -r dotenv/config ./scripts/seed.js", "start": "next start" }, "dependencies": {