Closed 1278real closed 2 years ago
Hi, I received a 400 Bad Request error when trying to use filter with current parsing. I fixed this in ck_filter.dart in class CKFilter :
ck_filter.dart
class CKFilter
class CKFilter { final CKComparator _comparator; final String _fieldName; final Map<String, dynamic> _fieldValueDictionary; final double? _distance; ///// THIS PART IS A FIX FOR NON-SYSTEMFIELD FILTERS dynamic _fieldValue; CKFilter(this._fieldName, CKFieldType fieldType, dynamic fieldValue, this._comparator, {double? distance}) : _fieldValue = (fieldValue != null) ? {'value': fieldValue, 'type': fieldType.record} : ((fieldType is num) ? 0 : ""), _fieldValueDictionary = { 'value': {_fieldName: fieldValue}, 'type': fieldType.record }, _distance = distance; /// Convert the filter to JSON. Map<String, dynamic> toJSON() => { 'comparator': _comparator._comparatorString, (CKConstants.isSystemFieldName(_fieldName) ? 'systemFieldName' : 'fieldName'): _fieldName, 'fieldValue': (CKConstants.isSystemFieldName(_fieldName) ? _fieldValueDictionary : _fieldValue), 'distance': _distance }; ///// END OF FIX }
this fixed the CKFilter issue.
Fixed via #5
Hi, I received a 400 Bad Request error when trying to use filter with current parsing. I fixed this in
ck_filter.dart
inclass CKFilter
: