mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 13:07:17 -04:00
Update Boards.userBoards()
to only return type 'board' by default
This commit is contained in:
parent
edd07befe2
commit
e43002d5ad
1 changed files with 13 additions and 12 deletions
|
@ -1330,8 +1330,11 @@ Boards.userBoards = (userId, archived = false, selector = {}) => {
|
|||
if (typeof archived === 'boolean') {
|
||||
selector.archived = archived;
|
||||
}
|
||||
selector.$or = [{ permission: 'public' }];
|
||||
if (!selector.type) {
|
||||
selector.type = 'board';
|
||||
}
|
||||
|
||||
selector.$or = [{ permission: 'public' }];
|
||||
if (userId) {
|
||||
selector.$or.push({ members: { $elemMatch: { userId, isActive: true } } });
|
||||
}
|
||||
|
@ -1435,17 +1438,15 @@ if (Meteor.isServer) {
|
|||
},
|
||||
myLabelNames() {
|
||||
let names = [];
|
||||
Boards.userBoards(Meteor.userId(), false, { type: 'board' }).forEach(
|
||||
board => {
|
||||
names = names.concat(
|
||||
board.labels
|
||||
.filter(label => !!label.name)
|
||||
.map(label => {
|
||||
return label.name;
|
||||
}),
|
||||
);
|
||||
},
|
||||
);
|
||||
Boards.userBoards(Meteor.userId()).forEach(board => {
|
||||
names = names.concat(
|
||||
board.labels
|
||||
.filter(label => !!label.name)
|
||||
.map(label => {
|
||||
return label.name;
|
||||
}),
|
||||
);
|
||||
});
|
||||
return _.uniq(names).sort();
|
||||
},
|
||||
myBoardNames() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue