mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01: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') {
|
if (typeof archived === 'boolean') {
|
||||||
selector.archived = archived;
|
selector.archived = archived;
|
||||||
}
|
}
|
||||||
selector.$or = [{ permission: 'public' }];
|
if (!selector.type) {
|
||||||
|
selector.type = 'board';
|
||||||
|
}
|
||||||
|
|
||||||
|
selector.$or = [{ permission: 'public' }];
|
||||||
if (userId) {
|
if (userId) {
|
||||||
selector.$or.push({ members: { $elemMatch: { userId, isActive: true } } });
|
selector.$or.push({ members: { $elemMatch: { userId, isActive: true } } });
|
||||||
}
|
}
|
||||||
|
|
@ -1435,17 +1438,15 @@ if (Meteor.isServer) {
|
||||||
},
|
},
|
||||||
myLabelNames() {
|
myLabelNames() {
|
||||||
let names = [];
|
let names = [];
|
||||||
Boards.userBoards(Meteor.userId(), false, { type: 'board' }).forEach(
|
Boards.userBoards(Meteor.userId()).forEach(board => {
|
||||||
board => {
|
names = names.concat(
|
||||||
names = names.concat(
|
board.labels
|
||||||
board.labels
|
.filter(label => !!label.name)
|
||||||
.filter(label => !!label.name)
|
.map(label => {
|
||||||
.map(label => {
|
return label.name;
|
||||||
return label.name;
|
}),
|
||||||
}),
|
);
|
||||||
);
|
});
|
||||||
},
|
|
||||||
);
|
|
||||||
return _.uniq(names).sort();
|
return _.uniq(names).sort();
|
||||||
},
|
},
|
||||||
myBoardNames() {
|
myBoardNames() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue