mirror of
https://github.com/wekan/wekan.git
synced 2025-12-18 00:10:13 +01:00
Create array of cards from card search result card ids instead of re-running
the search on the client side.
This commit is contained in:
parent
9061180983
commit
4ed5c3e4b8
1 changed files with 5 additions and 4 deletions
|
|
@ -61,9 +61,10 @@ export class CardSearchPagedComponent extends BlazeComponent {
|
|||
// eslint-disable-next-line no-console
|
||||
// console.log('selector:', sessionData.getSelector());
|
||||
console.log('session data:', sessionData);
|
||||
const projection = sessionData.getProjection();
|
||||
projection.skip = 0;
|
||||
const cards = Cards.find({ _id: { $in: sessionData.cards } }, projection);
|
||||
const cards = [];
|
||||
sessionData.cards.forEach(cardId => {
|
||||
cards.push(Cards.findOne({ _id: cardId }));
|
||||
});
|
||||
this.queryErrors = sessionData.errors;
|
||||
if (this.queryErrors.length) {
|
||||
// console.log('queryErrors:', this.queryErrorMessages());
|
||||
|
|
@ -73,7 +74,7 @@ export class CardSearchPagedComponent extends BlazeComponent {
|
|||
|
||||
if (cards) {
|
||||
this.totalHits = sessionData.totalHits;
|
||||
this.resultsCount = cards.count();
|
||||
this.resultsCount = cards.length;
|
||||
this.resultsStart = sessionData.lastHit - this.resultsCount + 1;
|
||||
this.resultsEnd = sessionData.lastHit;
|
||||
this.resultsHeading.set(this.getResultsHeading());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue