handle type ["integer"] in url and fix inbetween vs ["integer"] filter

This commit is contained in:
j 2023-07-06 11:52:36 +05:30
commit b7c201a74f
2 changed files with 32 additions and 19 deletions

View file

@ -683,15 +683,21 @@ Ox.URL = function(options) {
condition.operator = condition.operator.replace('=', '^')
}
}
var key = Ox.getObjectById(self.options.findKeys[state.type], condition.key)
if (
['date', 'enum', 'float', 'integer', 'time', 'year'].indexOf(
Ox.getObjectById(self.options.findKeys[state.type], condition.key).type
) > -1
['date', 'enum', 'float', 'integer', 'time', 'year'].indexOf(key.type) > -1
&& condition.value.indexOf(',') > -1
) {
condition.value = condition.value.split(',').map(function(value) {
return parseValue(decodeValue(value), condition.key, state);
});
} else if (Ox.isArray(key.type) && key.type[0] == "integer" && condition.value.indexOf(',') > -1) {
condition.value = condition.value.split(',').map(function(value) {
return parseValue(decodeValue(value), condition.key, state);
});
if (condition.value.length == 4) {
condition.value = [condition.value.slice(0,2), condition.value.slice(2)]
}
} else {
condition.value = parseValue(decodeValue(condition.value), condition.key, state);
}