1
0
Fork 0
mirror of synced 2024-10-02 18:16:29 +13:00

Use types

This commit is contained in:
Adria Navarro 2023-10-03 12:01:15 +02:00
parent f15ae4a69e
commit af924ae4a2

View file

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