From 93e6c1671e80c1532e843ae8a174878b6d23c13a Mon Sep 17 00:00:00 2001
From: Sanny Nguyen Hung <sanny.nguyen@digitalservice.bund.de>
Date: Thu, 22 Feb 2024 12:12:04 +0100
Subject: [PATCH] chore: remove hasTrackingConsent for custom events

---
 app/routes/shared/formular.server.ts   | 3 ++-
 app/routes/shared/vorabcheck.server.ts | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/routes/shared/formular.server.ts b/app/routes/shared/formular.server.ts
index 3f9d4176c..bfab01c36 100644
--- a/app/routes/shared/formular.server.ts
+++ b/app/routes/shared/formular.server.ts
@@ -282,12 +282,13 @@ export const action = async ({ request }: ActionFunctionArgs) => {
   });
 
   const customEventName = flowController.getMeta(stepId)?.customEventName;
-  if (customEventName)
+  if (customEventName) {
     sendCustomEvent({
       request,
       eventName: customEventName,
       properties: validationResult.data,
     });
+  }
 
   const returnTo = formData.get("_returnTo");
   const destination =
diff --git a/app/routes/shared/vorabcheck.server.ts b/app/routes/shared/vorabcheck.server.ts
index c1d4110e5..adb116140 100644
--- a/app/routes/shared/vorabcheck.server.ts
+++ b/app/routes/shared/vorabcheck.server.ts
@@ -178,12 +178,13 @@ export const action = async ({ request }: ActionFunctionArgs) => {
   });
 
   const customEventName = flowController.getMeta(stepId)?.customEventName;
-  if (customEventName)
+  if (customEventName) {
     sendCustomEvent({
       request,
       eventName: customEventName,
       properties: validationResult.data,
     });
+  }
 
   const destination =
     flowController.getNext(stepId)?.url ?? flowController.getInitial().url;