mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
32 lines
609 B
TypeScript
32 lines
609 B
TypeScript
import toast from "react-hot-toast";
|
|
|
|
export const deleteRecipient = (recipient: any) => {
|
|
if (!recipient.id) {
|
|
return;
|
|
}
|
|
|
|
return toast.promise(
|
|
fetch(
|
|
"/api/documents/" + recipient.documentId + "/recipients/" + recipient.id,
|
|
{
|
|
method: "DELETE",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
body: JSON.stringify(recipient),
|
|
}
|
|
),
|
|
{
|
|
loading: "Deleting...",
|
|
success: "Deleted.",
|
|
error: "Could not delete :/",
|
|
},
|
|
{
|
|
id: "delete",
|
|
style: {
|
|
minWidth: "200px",
|
|
},
|
|
}
|
|
);
|
|
};
|