Skip to content

Commit

Permalink
fix: fix query problem in nested namespaced datastores.
Browse files Browse the repository at this point in the history
  • Loading branch information
saul-jb committed Feb 27, 2024
1 parent 6805f41 commit 461e48a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/datastore-core/src/namespace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class NamespaceDatastore extends KeyTransformDatastore {
}

query.filters = (query.filters ?? []).map(filter => {
return ({ key, value }) => filter({ key: this.transform.convert(key), value })
return ({ key, value }) => filter({ key: this.transform.invert(key), value })
})

const { prefix } = q
Expand Down Expand Up @@ -79,7 +79,7 @@ export class NamespaceDatastore extends KeyTransformDatastore {
}

query.filters = (query.filters ?? []).map(filter => {
return (key) => filter(this.transform.convert(key))
return (key) => filter(this.transform.invert(key))
})

const { prefix } = q
Expand Down

0 comments on commit 461e48a

Please sign in to comment.