From 0a11b073e00452989fbb173a732999ac63d44e44 Mon Sep 17 00:00:00 2001 From: iamshoXy Date: Sat, 1 Jun 2024 16:52:38 +0200 Subject: [PATCH] Update --- backend/src/plugins/Counters/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/plugins/Counters/types.ts b/backend/src/plugins/Counters/types.ts index 289d06125..6734e8ce0 100644 --- a/backend/src/plugins/Counters/types.ts +++ b/backend/src/plugins/Counters/types.ts @@ -32,7 +32,7 @@ export const zTrigger = z .optional(), }) .transform((val, ctx) => { - const ruleName = String(ctx.path[ctx.path.length - 2]).trim(); + const ruleName = String(ctx.path[ctx.path.length - 1]).trim(); let reverseCondition = val.reverse_condition; if (!reverseCondition) { @@ -51,7 +51,7 @@ export const zTrigger = z }); const zTriggerFromString = zBoundedCharacters(0, 100).transform((val, ctx) => { - const ruleName = String(ctx.path[ctx.path.length - 2]).trim(); + const ruleName = String(ctx.path[ctx.path.length - 1]).trim(); const parsedCondition = parseCounterConditionString(val); if (!parsedCondition) { ctx.addIssue({