From ebe23335f896fa3843da56a929c909d25fe4e55a Mon Sep 17 00:00:00 2001
From: Catalin Pit <25515812+catalinpit@users.noreply.github.com>
Date: Thu, 29 Feb 2024 08:37:01 +0200
Subject: [PATCH] fix: return the recipient as an array to match other formats
from zapier (#971)
Return the recipient as an array to match the other formats for Zapier.
Otherwise, Zaps with the "DOCUMENT_OPENED" hooks won't work.
All the other webhooks return the "Recipient" field as an array.
---
.../src/app/(marketing)/singleplayer/[token]/success/page.tsx | 2 +-
.../single-player-mode/single-player-mode-success.tsx | 4 ++--
packages/lib/server-only/document/get-document-by-token.ts | 2 +-
packages/prisma/types/document-with-recipient.ts | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/apps/marketing/src/app/(marketing)/singleplayer/[token]/success/page.tsx b/apps/marketing/src/app/(marketing)/singleplayer/[token]/success/page.tsx
index fbf020c38..51fbaff36 100644
--- a/apps/marketing/src/app/(marketing)/singleplayer/[token]/success/page.tsx
+++ b/apps/marketing/src/app/(marketing)/singleplayer/[token]/success/page.tsx
@@ -27,7 +27,7 @@ export default async function SinglePlayerModeSuccessPage({
return notFound();
}
- const signatures = await getRecipientSignatures({ recipientId: document.Recipient.id });
+ const signatures = await getRecipientSignatures({ recipientId: document.Recipient[0].id });
return