Skip to content

Commit

Permalink
Merge pull request #340 from jiho-kr/feature/search-bug
Browse files Browse the repository at this point in the history
fix: next page bug on search
  • Loading branch information
jiho-kr authored Oct 26, 2023
2 parents dc13aa2 + c3a5841 commit 6f71931
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/lib/interceptor/search-request.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,11 @@ export function SearchRequestInterceptor(crudOptions: CrudOptions, factoryOption
}),
{},
);

let mergedKeySet: Set<string> = new Set();
for (const queryFilter of where) {
for (const [key, operation] of Object.entries(cursorCondition)) {
mergedKeySet.add(key);
_.merge(
queryFilter,
key in queryFilter
Expand All @@ -286,7 +289,13 @@ export function SearchRequestInterceptor(crudOptions: CrudOptions, factoryOption
);
}
}
where.push(cursorCondition);
for (const [key, operation] of Object.entries(cursorCondition)) {
if (mergedKeySet.has(key)) {
continue;
}
where.push({ [key]: operation });
}

return where;
}
}
Expand Down

0 comments on commit 6f71931

Please sign in to comment.