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
6 changes: 3 additions & 3 deletions apps/dashboard/src/app/(dashboard)/invoices/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,11 @@ export default function InvoicesPage() {
}
};

const handleSendExisting = async (invoice: Invoice) => {
const handleSendExisting = async (invoice: Invoice, message?: string) => {
try {
await sendInvoice.mutateAsync({ id: invoice.id });
await sendInvoice.mutateAsync({ id: invoice.id, message });
toast(`Invoice sent to ${invoice.customerEmail}.`, "success");
// Update the detail sheet if it's showing this invoice
// Reflect status change in the detail sheet without waiting for a refetch
setDetailInvoice((prev) =>
prev?.id === invoice.id ? { ...prev, status: "SENT" } : prev,
);
Expand Down
Loading
Loading