From 998fba2c06e39bac59b690fa9a7f6f5d7d254419 Mon Sep 17 00:00:00 2001 From: Kushal <43465488+kushalshit27@users.noreply.github.com> Date: Wed, 18 Dec 2024 14:33:04 +0530 Subject: [PATCH] Fix: Import operation emailProvider and custom email provider action in the same execution (#1005) Fix: Adjust order of processChanges to ensure that actions are created before email provider is updated --- src/tools/auth0/handlers/actions.ts | 2 +- src/tools/auth0/handlers/emailProvider.ts | 3 ++- src/tools/auth0/handlers/emailTemplates.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tools/auth0/handlers/actions.ts b/src/tools/auth0/handlers/actions.ts index 3a60026a5..3111cd258 100644 --- a/src/tools/auth0/handlers/actions.ts +++ b/src/tools/auth0/handlers/actions.ts @@ -244,7 +244,7 @@ export default class ActionHandler extends DefaultAPIHandler { } } - @order('60') + @order('50') async processChanges(assets: Assets) { const { actions } = assets; diff --git a/src/tools/auth0/handlers/emailProvider.ts b/src/tools/auth0/handlers/emailProvider.ts index ae4ad2cb4..a116b7f7d 100644 --- a/src/tools/auth0/handlers/emailProvider.ts +++ b/src/tools/auth0/handlers/emailProvider.ts @@ -1,6 +1,6 @@ import { EmailProviderCreate } from 'auth0'; import { isEmpty } from 'lodash'; -import DefaultHandler from './default'; +import DefaultHandler, { order } from './default'; import { Asset, Assets } from '../../../types'; export const schema = { type: 'object' }; @@ -33,6 +33,7 @@ export default class EmailProviderHandler extends DefaultHandler { return super.objString({ name: provider.name, enabled: provider.enabled }); } + @order('60') async processChanges(assets: Assets): Promise { const { emailProvider } = assets; diff --git a/src/tools/auth0/handlers/emailTemplates.ts b/src/tools/auth0/handlers/emailTemplates.ts index b6f93147a..0e6529817 100644 --- a/src/tools/auth0/handlers/emailTemplates.ts +++ b/src/tools/auth0/handlers/emailTemplates.ts @@ -72,7 +72,7 @@ export default class EmailTemplateHandler extends DefaultHandler { } // Run after email provider changes - @order('60') + @order('70') async processChanges(assets: Assets): Promise { const { emailTemplates } = assets;