fix: incorrect data for postMessage

This commit is contained in:
Lucas Smith
2025-05-02 10:50:13 +10:00
parent 17370749b4
commit e108da546d
2 changed files with 16 additions and 16 deletions

View File

@ -1,5 +1,6 @@
import { useLayoutEffect, useMemo, useState } from 'react';
import { msg } from '@lingui/core/macro';
import { useLingui } from '@lingui/react';
import { DocumentDistributionMethod, DocumentSigningOrder, SigningStatus } from '@prisma/client';
import { redirect, useLoaderData } from 'react-router';
@ -187,8 +188,8 @@ export default function EmbeddingAuthoringDocumentEditPage() {
if (!configuration) {
toast({
variant: 'destructive',
title: _('Error'),
description: _('Please configure the document first'),
title: _(msg`Error`),
description: _(msg`Please configure the document first`),
});
return;
@ -240,8 +241,8 @@ export default function EmbeddingAuthoringDocumentEditPage() {
});
toast({
title: _('Success'),
description: _('Document updated successfully'),
title: _(msg`Success`),
description: _(msg`Document updated successfully`),
});
// Send a message to the parent window with the document details
@ -249,8 +250,7 @@ export default function EmbeddingAuthoringDocumentEditPage() {
window.parent.postMessage(
{
type: 'document-updated',
// documentId: updateResult.documentId,
documentId: 1,
documentId: updateResult.documentId,
externalId: documentExternalId,
},
'*',
@ -261,8 +261,8 @@ export default function EmbeddingAuthoringDocumentEditPage() {
toast({
variant: 'destructive',
title: _('Error'),
description: _('Failed to update document'),
title: _(msg`Error`),
description: _(msg`Failed to update document`),
});
}
};

View File

@ -1,5 +1,6 @@
import { useLayoutEffect, useMemo, useState } from 'react';
import { msg } from '@lingui/core/macro';
import { useLingui } from '@lingui/react';
import { DocumentDistributionMethod, DocumentSigningOrder, SigningStatus } from '@prisma/client';
import { redirect, useLoaderData } from 'react-router';
@ -187,8 +188,8 @@ export default function EmbeddingAuthoringTemplateEditPage() {
if (!configuration) {
toast({
variant: 'destructive',
title: _('Error'),
description: _('Please configure the document first'),
title: _(msg`Error`),
description: _(msg`Please configure the document first`),
});
return;
@ -240,8 +241,8 @@ export default function EmbeddingAuthoringTemplateEditPage() {
});
toast({
title: _('Success'),
description: _('Document updated successfully'),
title: _(msg`Success`),
description: _(msg`Template updated successfully`),
});
// Send a message to the parent window with the template details
@ -249,8 +250,7 @@ export default function EmbeddingAuthoringTemplateEditPage() {
window.parent.postMessage(
{
type: 'template-updated',
// templateId: updateResult.templateId,
templateId: 1,
templateId: updateResult.templateId,
externalId: templateExternalId,
},
'*',
@ -261,8 +261,8 @@ export default function EmbeddingAuthoringTemplateEditPage() {
toast({
variant: 'destructive',
title: _('Error'),
description: _('Failed to update template'),
title: _(msg`Error`),
description: _(msg`Failed to update template`),
});
}
};