Skip to content

Commit

Permalink
fix: search next cursor bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jiho-kr committed Oct 26, 2023
1 parent b86bc3c commit c3a5841
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 c3a5841

Please sign in to comment.