Skip to content

Commit

Permalink
fix(pluginfields): type checks
Browse files Browse the repository at this point in the history
  • Loading branch information
thompsonsj committed Aug 16, 2024
1 parent 4fd5cb0 commit 2ded7ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/src/lib/fields/pluginFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 2ded7ea

Please sign in to comment.