mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
fix: incorrect data for postMessage
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
import { useLayoutEffect, useMemo, useState } from 'react';
|
import { useLayoutEffect, useMemo, useState } from 'react';
|
||||||
|
|
||||||
|
import { msg } from '@lingui/core/macro';
|
||||||
import { useLingui } from '@lingui/react';
|
import { useLingui } from '@lingui/react';
|
||||||
import { DocumentDistributionMethod, DocumentSigningOrder, SigningStatus } from '@prisma/client';
|
import { DocumentDistributionMethod, DocumentSigningOrder, SigningStatus } from '@prisma/client';
|
||||||
import { redirect, useLoaderData } from 'react-router';
|
import { redirect, useLoaderData } from 'react-router';
|
||||||
@ -187,8 +188,8 @@ export default function EmbeddingAuthoringDocumentEditPage() {
|
|||||||
if (!configuration) {
|
if (!configuration) {
|
||||||
toast({
|
toast({
|
||||||
variant: 'destructive',
|
variant: 'destructive',
|
||||||
title: _('Error'),
|
title: _(msg`Error`),
|
||||||
description: _('Please configure the document first'),
|
description: _(msg`Please configure the document first`),
|
||||||
});
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -240,8 +241,8 @@ export default function EmbeddingAuthoringDocumentEditPage() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: _('Success'),
|
title: _(msg`Success`),
|
||||||
description: _('Document updated successfully'),
|
description: _(msg`Document updated successfully`),
|
||||||
});
|
});
|
||||||
|
|
||||||
// Send a message to the parent window with the document details
|
// Send a message to the parent window with the document details
|
||||||
@ -249,8 +250,7 @@ export default function EmbeddingAuthoringDocumentEditPage() {
|
|||||||
window.parent.postMessage(
|
window.parent.postMessage(
|
||||||
{
|
{
|
||||||
type: 'document-updated',
|
type: 'document-updated',
|
||||||
// documentId: updateResult.documentId,
|
documentId: updateResult.documentId,
|
||||||
documentId: 1,
|
|
||||||
externalId: documentExternalId,
|
externalId: documentExternalId,
|
||||||
},
|
},
|
||||||
'*',
|
'*',
|
||||||
@ -261,8 +261,8 @@ export default function EmbeddingAuthoringDocumentEditPage() {
|
|||||||
|
|
||||||
toast({
|
toast({
|
||||||
variant: 'destructive',
|
variant: 'destructive',
|
||||||
title: _('Error'),
|
title: _(msg`Error`),
|
||||||
description: _('Failed to update document'),
|
description: _(msg`Failed to update document`),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { useLayoutEffect, useMemo, useState } from 'react';
|
import { useLayoutEffect, useMemo, useState } from 'react';
|
||||||
|
|
||||||
|
import { msg } from '@lingui/core/macro';
|
||||||
import { useLingui } from '@lingui/react';
|
import { useLingui } from '@lingui/react';
|
||||||
import { DocumentDistributionMethod, DocumentSigningOrder, SigningStatus } from '@prisma/client';
|
import { DocumentDistributionMethod, DocumentSigningOrder, SigningStatus } from '@prisma/client';
|
||||||
import { redirect, useLoaderData } from 'react-router';
|
import { redirect, useLoaderData } from 'react-router';
|
||||||
@ -187,8 +188,8 @@ export default function EmbeddingAuthoringTemplateEditPage() {
|
|||||||
if (!configuration) {
|
if (!configuration) {
|
||||||
toast({
|
toast({
|
||||||
variant: 'destructive',
|
variant: 'destructive',
|
||||||
title: _('Error'),
|
title: _(msg`Error`),
|
||||||
description: _('Please configure the document first'),
|
description: _(msg`Please configure the document first`),
|
||||||
});
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -240,8 +241,8 @@ export default function EmbeddingAuthoringTemplateEditPage() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: _('Success'),
|
title: _(msg`Success`),
|
||||||
description: _('Document updated successfully'),
|
description: _(msg`Template updated successfully`),
|
||||||
});
|
});
|
||||||
|
|
||||||
// Send a message to the parent window with the template details
|
// Send a message to the parent window with the template details
|
||||||
@ -249,8 +250,7 @@ export default function EmbeddingAuthoringTemplateEditPage() {
|
|||||||
window.parent.postMessage(
|
window.parent.postMessage(
|
||||||
{
|
{
|
||||||
type: 'template-updated',
|
type: 'template-updated',
|
||||||
// templateId: updateResult.templateId,
|
templateId: updateResult.templateId,
|
||||||
templateId: 1,
|
|
||||||
externalId: templateExternalId,
|
externalId: templateExternalId,
|
||||||
},
|
},
|
||||||
'*',
|
'*',
|
||||||
@ -261,8 +261,8 @@ export default function EmbeddingAuthoringTemplateEditPage() {
|
|||||||
|
|
||||||
toast({
|
toast({
|
||||||
variant: 'destructive',
|
variant: 'destructive',
|
||||||
title: _('Error'),
|
title: _(msg`Error`),
|
||||||
description: _('Failed to update template'),
|
description: _(msg`Failed to update template`),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user