add LIKE filtering on number value by default
All checks were successful
Release / meta (push) Successful in 1m54s
Release / linux-build (push) Successful in 2m4s
Release / web-build (push) Successful in 1m29s
Release / android-build (push) Successful in 7m17s
Release / release-master (push) Successful in 20s
Release / release-dev (push) Successful in 24s
All checks were successful
Release / meta (push) Successful in 1m54s
Release / linux-build (push) Successful in 2m4s
Release / web-build (push) Successful in 1m29s
Release / android-build (push) Successful in 7m17s
Release / release-master (push) Successful in 20s
Release / release-dev (push) Successful in 24s
This commit is contained in:
@@ -32,7 +32,7 @@ extension DataServiceTraction on DataService {
|
|||||||
payload['class'] = locoClass;
|
payload['class'] = locoClass;
|
||||||
}
|
}
|
||||||
if (locoNumber != null && locoNumber.isNotEmpty) {
|
if (locoNumber != null && locoNumber.isNotEmpty) {
|
||||||
payload['number'] = locoNumber;
|
payload['number'] = _withLikeWildcards(locoNumber);
|
||||||
}
|
}
|
||||||
if (filters != null) {
|
if (filters != null) {
|
||||||
filters.forEach((key, value) {
|
filters.forEach((key, value) {
|
||||||
@@ -67,6 +67,14 @@ extension DataServiceTraction on DataService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String _withLikeWildcards(String rawValue) {
|
||||||
|
final value = rawValue.trim();
|
||||||
|
if (value.isEmpty) return value;
|
||||||
|
final hasLeadingWildcard = value.startsWith('%');
|
||||||
|
final hasTrailingWildcard = value.endsWith('%');
|
||||||
|
return '${hasLeadingWildcard ? '' : '%'}$value${hasTrailingWildcard ? '' : '%'}';
|
||||||
|
}
|
||||||
|
|
||||||
Future<List<LocoAttrVersion>> fetchLocoTimeline(
|
Future<List<LocoAttrVersion>> fetchLocoTimeline(
|
||||||
int locoId, {
|
int locoId, {
|
||||||
bool includeAllPending = false,
|
bool includeAllPending = false,
|
||||||
|
|||||||
Reference in New Issue
Block a user