From e108da546dba538ca95fd144705d60aee5707d58 Mon Sep 17 00:00:00 2001 From: Lucas Smith Date: Fri, 2 May 2025 10:50:13 +1000 Subject: [PATCH] fix: incorrect data for postMessage --- .../embed+/v1+/authoring+/document.edit.$id.tsx | 16 ++++++++-------- .../embed+/v1+/authoring+/template.edit.$id.tsx | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apps/remix/app/routes/embed+/v1+/authoring+/document.edit.$id.tsx b/apps/remix/app/routes/embed+/v1+/authoring+/document.edit.$id.tsx index 41b97e654..9bb820ec3 100644 --- a/apps/remix/app/routes/embed+/v1+/authoring+/document.edit.$id.tsx +++ b/apps/remix/app/routes/embed+/v1+/authoring+/document.edit.$id.tsx @@ -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`), }); } }; diff --git a/apps/remix/app/routes/embed+/v1+/authoring+/template.edit.$id.tsx b/apps/remix/app/routes/embed+/v1+/authoring+/template.edit.$id.tsx index 7c5cef644..dbf88ad1c 100644 --- a/apps/remix/app/routes/embed+/v1+/authoring+/template.edit.$id.tsx +++ b/apps/remix/app/routes/embed+/v1+/authoring+/template.edit.$id.tsx @@ -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`), }); } };