mirror of
https://github.com/wekan/wekan.git
synced 2025-12-27 04:38:49 +01:00
Fix search returning data for all users
This commit is contained in:
parent
5dbbaae6fd
commit
39ac19db20
2 changed files with 8 additions and 6 deletions
|
|
@ -1226,6 +1226,8 @@ Boards.userSearch = (
|
||||||
};
|
};
|
||||||
|
|
||||||
Boards.userBoards = (userId, includeArchived = false, selector = {}) => {
|
Boards.userBoards = (userId, includeArchived = false, selector = {}) => {
|
||||||
|
check(userId, String);
|
||||||
|
|
||||||
if (!includeArchived) {
|
if (!includeArchived) {
|
||||||
selector = {
|
selector = {
|
||||||
archived: false,
|
archived: false,
|
||||||
|
|
|
||||||
|
|
@ -1731,9 +1731,9 @@ Cards.mutations({
|
||||||
});
|
});
|
||||||
|
|
||||||
Cards.globalSearch = queryParams => {
|
Cards.globalSearch = queryParams => {
|
||||||
const userId = Meteor.userId;
|
const userId = Meteor.userId();
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
// console.log('userId:', this.userId);
|
console.log('userId:', userId);
|
||||||
|
|
||||||
const errors = {
|
const errors = {
|
||||||
notFound: {
|
notFound: {
|
||||||
|
|
@ -1838,9 +1838,9 @@ Cards.globalSearch = queryParams => {
|
||||||
if (boards.count()) {
|
if (boards.count()) {
|
||||||
boards.forEach(board => {
|
boards.forEach(board => {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log('board:', board);
|
// console.log('board:', board);
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log('board.labels:', board.labels);
|
// console.log('board.labels:', board.labels);
|
||||||
board.labels
|
board.labels
|
||||||
.filter(boardLabel => {
|
.filter(boardLabel => {
|
||||||
return boardLabel.color === label.toLowerCase();
|
return boardLabel.color === label.toLowerCase();
|
||||||
|
|
@ -1885,7 +1885,7 @@ Cards.globalSearch = queryParams => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
// console.log('selector:', selector);
|
console.log('selector:', selector);
|
||||||
const cards = Cards.find(selector, {
|
const cards = Cards.find(selector, {
|
||||||
fields: {
|
fields: {
|
||||||
_id: 1,
|
_id: 1,
|
||||||
|
|
@ -1906,7 +1906,7 @@ Cards.globalSearch = queryParams => {
|
||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
// console.log('count:', cards.count());
|
console.log('count:', cards.count());
|
||||||
return { cards, errors };
|
return { cards, errors };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue