From 2ded7ea6d98bbdc4441a93100585dc54d146b2e0 Mon Sep 17 00:00:00 2001 From: Steven Thompson <44806974+thompsonsj@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:14:41 +0100 Subject: [PATCH] fix(pluginfields): type checks --- plugin/src/lib/fields/pluginFields.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/src/lib/fields/pluginFields.ts b/plugin/src/lib/fields/pluginFields.ts index df3851a..601fb82 100644 --- a/plugin/src/lib/fields/pluginFields.ts +++ b/plugin/src/lib/fields/pluginFields.ts @@ -67,7 +67,7 @@ export const pluginCollectionOrGlobalFields = ({ }], afterChange: [async ({ context, req }) => { // type check context, if valid we can safely assume translation updates are desired - if (typeof context['articleDirectoryId'] === 'string' && typeof context['draft'] === 'boolean' && Array.isArray(context['excludeLocales']) && context["syncTranslations"]) + if (typeof context['articleDirectoryId'] === 'string' && typeof context['draft'] === 'boolean' && Array.isArray(context['excludeLocales']) && typeof context["syncTranslations"] === 'boolean') await updatePayloadTranslation({ articleDirectoryId: context['articleDirectoryId'], pluginOptions, @@ -108,7 +108,7 @@ export const pluginCollectionOrGlobalFields = ({ }], afterChange: [async ({ context, req }) => { // type check context, if valid we can safely assume translation updates are desired - if (typeof context['articleDirectoryId'] === 'string' && typeof context['draft'] === 'boolean' && context["syncAllTranslations"]) + if (typeof context['articleDirectoryId'] === 'string' && typeof context['draft'] === 'boolean' && typeof context["syncAllTranslations"] === 'boolean') await updatePayloadTranslation({ articleDirectoryId: context['articleDirectoryId'], pluginOptions,