Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

merge: Merge remote-tracking branch 'refs/remotes/origin/main' into papermark-team-feature

Aashish-Upadhyay-101c0e6790f367e
diff --cc components/domains/add-domain-modal.tsx
index 2fe90cd1,2af4e3c8..9e45e117
--- a/components/domains/add-domain-modal.tsx
+++ b/components/domains/add-domain-modal.tsx
@@@ -37,24 -34,21 +37,24 @@@ export function AddDomainModal(
if (domain == "") return;
setLoading(true);
- const response = await fetch("/api/domains", {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify({
- domain: domain,
- }),
- });
+ const response = await fetch(
+ `/api/teams/${teamInfo?.currentTeam?.id}/domains`,
+ {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({
+ domain: domain,
+ }),
+ }
+ );
if (!response.ok) {
- const error = await response.json();
+ const { message } = await response.json();
setLoading(false);
setOpen(false);
- toast.error(error);
+ toast.error(message);
return;
}