Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions dashboard/final-example/app/lib/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,8 @@ export async function updateInvoice(
}

export async function deleteInvoice(id: string) {
// throw new Error('Failed to Delete Invoice');

try {
await sql`DELETE FROM invoices WHERE id = ${id}`;
revalidatePath('/dashboard/invoices');
return { message: 'Deleted Invoice' };
} catch (error) {
return { message: 'Database Error: Failed to Delete Invoice.' };
}
await sql`DELETE FROM invoices WHERE id = ${id}`;
revalidatePath('/dashboard/invoices');
}

export async function authenticate(
Expand Down
20 changes: 7 additions & 13 deletions dashboard/final-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": true,
"scripts": {
"build": "next build",
"dev": "next dev --turbo",
"dev": "next dev --turbopack",
"start": "next start"
},
"dependencies": {
Expand All @@ -12,26 +12,20 @@
"autoprefixer": "10.4.20",
"bcrypt": "^5.1.1",
"clsx": "^2.1.1",
"next": "^15.0.3",
"next": "latest",
"next-auth": "5.0.0-beta.19",
"postcss": "8.4.49",
"react": "19.0.0-rc-cd22717c-20241013",
"react-dom": "19.0.0-rc-cd22717c-20241013",
"tailwindcss": "3.4.15",
"react": "19.0.0",
"react-dom": "19.0.0",
"tailwindcss": "3.4.16",
"typescript": "5.7.2",
"use-debounce": "^10.0.4",
"zod": "^3.23.8"
},
"devDependencies": {
"@types/bcrypt": "^5.0.2",
"@types/node": "22.10.1",
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]"
},
"pnpm": {
"overrides": {
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]"
}
"@types/react": "19.0.0",
"@types/react-dom": "19.0.0"
}
}
Loading
Loading