From 01dac9fa57138dfb753b3f30e3d913067ba03348 Mon Sep 17 00:00:00 2001 From: Marco Ponchia Date: Fri, 6 Dec 2024 17:56:19 +0100 Subject: [PATCH 1/2] Fix webinar validateSlug --- .../src/api/webinar/content-types/webinar/lifecycles.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/strapi-cms/src/api/webinar/content-types/webinar/lifecycles.ts b/apps/strapi-cms/src/api/webinar/content-types/webinar/lifecycles.ts index cc0af4ca3..39085e59e 100644 --- a/apps/strapi-cms/src/api/webinar/content-types/webinar/lifecycles.ts +++ b/apps/strapi-cms/src/api/webinar/content-types/webinar/lifecycles.ts @@ -65,7 +65,11 @@ const validateDates = (event: IWebinarEvent): boolean => { }; const validateSlug = async (event: IWebinarEvent): Promise => { - const { id } = event.params.data; + if (!event.params.data.slug || !activeCampaignIntegrationIsEnabled) { + return true; + } + + const id = event.params.where?.id; if (!id) { throw new errors.ApplicationError('Webinar id not found'); } From af7eeb6d9bcdfa7ce103df4c0e841a65d86d106a Mon Sep 17 00:00:00 2001 From: Marco Ponchia Date: Fri, 6 Dec 2024 17:57:08 +0100 Subject: [PATCH 2/2] add changeset --- .changeset/pretty-gorillas-bow.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/pretty-gorillas-bow.md diff --git a/.changeset/pretty-gorillas-bow.md b/.changeset/pretty-gorillas-bow.md new file mode 100644 index 000000000..750a34a16 --- /dev/null +++ b/.changeset/pretty-gorillas-bow.md @@ -0,0 +1,5 @@ +--- +"strapi-cms": minor +--- + +Fix webinar validateSlug on update