mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
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.
This commit is contained in:
@ -27,7 +27,7 @@ export default async function SinglePlayerModeSuccessPage({
|
|||||||
return notFound();
|
return notFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
const signatures = await getRecipientSignatures({ recipientId: document.Recipient.id });
|
const signatures = await getRecipientSignatures({ recipientId: document.Recipient[0].id });
|
||||||
|
|
||||||
return <SinglePlayerModeSuccess document={document} signatures={signatures} />;
|
return <SinglePlayerModeSuccess document={document} signatures={signatures} />;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,7 +55,7 @@ export const SinglePlayerModeSuccess = ({
|
|||||||
|
|
||||||
<SigningCard3D
|
<SigningCard3D
|
||||||
className="mt-8"
|
className="mt-8"
|
||||||
name={document.Recipient.name || document.Recipient.email}
|
name={document.Recipient[0].name || document.Recipient[0].email}
|
||||||
signature={signatures.at(0)}
|
signature={signatures.at(0)}
|
||||||
signingCelebrationImage={signingCelebration}
|
signingCelebrationImage={signingCelebration}
|
||||||
/>
|
/>
|
||||||
@ -65,7 +65,7 @@ export const SinglePlayerModeSuccess = ({
|
|||||||
<div className="grid w-full max-w-sm grid-cols-2 gap-4">
|
<div className="grid w-full max-w-sm grid-cols-2 gap-4">
|
||||||
<DocumentShareButton
|
<DocumentShareButton
|
||||||
documentId={document.id}
|
documentId={document.id}
|
||||||
token={document.Recipient.token}
|
token={document.Recipient[0].token}
|
||||||
className="flex-1 bg-transparent backdrop-blur-sm"
|
className="flex-1 bg-transparent backdrop-blur-sm"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@ -70,6 +70,6 @@ export const getDocumentAndRecipientByToken = async ({
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
...result,
|
...result,
|
||||||
Recipient: result.Recipient[0],
|
Recipient: result.Recipient,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -5,6 +5,6 @@ export type DocumentWithRecipients = Document & {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type DocumentWithRecipient = Document & {
|
export type DocumentWithRecipient = Document & {
|
||||||
Recipient: Recipient;
|
Recipient: Recipient[];
|
||||||
documentData: DocumentData;
|
documentData: DocumentData;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user