Use types

This commit is contained in:
Adria Navarro 2023-10-03 12:01:15 +02:00
parent f15ae4a69e
commit af924ae4a2
1 changed files with 8 additions and 8 deletions

View File

@ -44,21 +44,21 @@ export const getValidOperatorsForType = (
value: string value: string
label: string label: string
}[] = [] }[] = []
if (type === "string") { if (type === FieldType.STRING) {
ops = stringOps ops = stringOps
} else if (type === "number" || type === "bigint") { } else if (type === FieldType.NUMBER || type === FieldType.BIGINT) {
ops = numOps ops = numOps
} else if (type === "options") { } else if (type === FieldType.OPTIONS) {
ops = [Op.Equals, Op.NotEquals, Op.Empty, Op.NotEmpty, Op.In] ops = [Op.Equals, Op.NotEquals, Op.Empty, Op.NotEmpty, Op.In]
} else if (type === "array") { } else if (type === FieldType.ARRAY) {
ops = [Op.Contains, Op.NotContains, Op.Empty, Op.NotEmpty, Op.ContainsAny] ops = [Op.Contains, Op.NotContains, Op.Empty, Op.NotEmpty, Op.ContainsAny]
} else if (type === "boolean") { } else if (type === FieldType.BOOLEAN) {
ops = [Op.Equals, Op.NotEquals, Op.Empty, Op.NotEmpty] ops = [Op.Equals, Op.NotEquals, Op.Empty, Op.NotEmpty]
} else if (type === "longform") { } else if (type === FieldType.LONGFORM) {
ops = stringOps ops = stringOps
} else if (type === "datetime") { } else if (type === FieldType.DATETIME) {
ops = numOps ops = numOps
} else if (type === "formula") { } else if (type === FieldType.FORMULA) {
ops = stringOps.concat([Op.MoreThan, Op.LessThan]) ops = stringOps.concat([Op.MoreThan, Op.LessThan])
} }