Chapter 12 - Implement deleting invoices
This commit is contained in:
@@ -55,4 +55,9 @@ export async function updateInvoice(id: string, formData: FormData) {
|
||||
|
||||
revalidatePath('/dashboard/invoices');
|
||||
redirect('/dashboard/invoices');
|
||||
}
|
||||
|
||||
export async function deleteInvoice(id: string) {
|
||||
await sql`DELETE FROM invoices WHERE id = ${id}`;
|
||||
revalidatePath('/dashboard/invoices');
|
||||
}
|
||||
Reference in New Issue
Block a user