Skip to content

Commit

Permalink
Fix wrong query when empty filter #1
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitrov-adrian committed May 20, 2022
1 parent 6abeb3f commit 6cd7a3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/interface.vue
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,14 @@ async function refreshSuggestions(keyword: string) {
const currentIds = items.value
.map((i) => i[relationInfo.value.junctionField.field][relationInfo.value.relatedPrimaryKeyField.field])
.filter((i) => !!i);
const query = {
params: {
limit: 10,
fields: fetchFields,
filter: {
_and: [
parseFilter(props.filter, null) || null,
props.filter && parseFilter(props.filter, null),
currentIds.length > 0 && {
[relationInfo.value.relatedPrimaryKeyField.field]: {
_nin: currentIds.join(','),
Expand Down

0 comments on commit 6cd7a3e

Please sign in to comment.