2 parents c7c4f17 + 0a996ee commit 48e1d42Copy full SHA for 48e1d42
1 file changed
src/app/services/recipe.service.ts
@@ -92,14 +92,14 @@ export class RecipeService {
92
!(result instanceof ErrorWrapper) &&
93
result.length < RecipeService.queryLimit
94
) {
95
- const set = new Set<DocumentType<RecipeClass>>();
96
- result.forEach((i) => set.add(i));
+ const map = new Map<String, DocumentType<RecipeClass>>();
+ result.forEach((i) => map.set(i.id, i));
97
const moreResults = await this.searchRemainingWithRegex(
98
searchString,
99
RecipeService.queryLimit - result.length
100
);
101
- moreResults.forEach((i) => set.add(i));
102
- result = Array.from(set);
+ moreResults.forEach((i) => map.set(i.id, i));
+ result = Array.from(map.values());
103
}
104
if (result instanceof ErrorWrapper) {
105
response.setValuesList(
0 commit comments