Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 799fbad

Browse files
fix: search entries not contains filter (#1416)
Signed-off-by: peterpeterparker <[email protected]>
1 parent acbdff0 commit 799fbad

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

canisters/src/data/data.filter.mo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ module {
1818
};
1919
};
2020

21-
public func contains(key: Text, contains: ?Text): Bool {
22-
switch (contains) {
21+
public func notContains(key: Text, notContains: ?Text): Bool {
22+
switch (notContains) {
2323
case null {
2424
return true;
2525
};
26-
case (?contains) {
27-
return Text.contains(key, #text contains);
26+
case (?notContains) {
27+
return not Text.contains(key, #text notContains);
2828
};
2929
};
3030
};

canisters/src/data/data.store.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module {
4545
let {startsWith; notContains} = filter;
4646

4747
let values: [(Text, T)] = Array.mapFilter<(Text, T), (Text, T)>(keyValues, func ((key: Text, value: T)) : ?(Text, T) {
48-
if (Filter.startsWith(key, startsWith) and not Filter.contains(key, notContains)) {
48+
if (Filter.startsWith(key, startsWith) and Filter.notContains(key, notContains)) {
4949
return ?(key, value);
5050
};
5151

0 commit comments

Comments
 (0)