Skip to content

Commit

Permalink
fix: PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aimensahnoun committed Feb 14, 2025
1 parent 1bce111 commit 6f6ca5e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/invoice-me-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,16 @@ export function InvoiceMeLink({ link, origin }: InvoiceMeLinkProps) {
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={async () => {
await deleteInvoiceMeLink(link.id);
try {
await deleteInvoiceMeLink(link.id);
toast.success("Invoice Me link deleted");
} catch (error) {
console.error(error);
toast.error("Failed to delete Invoice Me link", {
description:
"Please try again later or contact support if the problem persists.",
});
}
}}
className="bg-red-600 hover:bg-red-700"
>
Expand Down
7 changes: 7 additions & 0 deletions src/server/routers/invoice-me.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ export const invoiceMeRouter = router({
},
});

if (!invoiceMeLink) {
throw new TRPCError({
code: "NOT_FOUND",
message: "Invoice me link not found",
});
}

return invoiceMeLink;
}),
});

0 comments on commit 6f6ca5e

Please sign in to comment.