Skip to content

Commit

Permalink
Merge pull request #480 from iamshoXy/counterfix
Browse files Browse the repository at this point in the history
fix: wrong key for counter's counter_trigger rule name
  • Loading branch information
Dragory authored Aug 11, 2024
2 parents 43b8017 + 0a11b07 commit 4ead472
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/src/plugins/Counters/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,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) {
Expand All @@ -52,7 +52,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({
Expand Down

0 comments on commit 4ead472

Please sign in to comment.