Skip to content

Commit 32e390e

Browse files
authored
Merge pull request #530 from seeyebe/fix/slashcmd-case-types-enum-filter
Fix: Filter numeric enum keys from case type slash command options
2 parents 3ef8924 + 0b3fdea commit 32e390e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/src/plugins/ModActions/commands/addcase/AddCaseSlashCmd.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ export const AddCaseSlashCmd = modActionsSlashCmd({
2828
name: "type",
2929
description: "The type of case to add",
3030
required: true,
31-
choices: Object.keys(CaseTypes).map((type) => ({ name: type, value: type })),
31+
choices: Object.keys(CaseTypes)
32+
.filter((key) => isNaN(Number(key)))
33+
.map((key) => ({ name: key, value: key })),
3234
}),
3335
slashOptions.user({ name: "user", description: "The user to add a case to", required: true }),
3436

0 commit comments

Comments
 (0)