My Cards development

first prototype
This commit is contained in:
John R. Supplee 2020-12-31 19:14:55 +02:00
parent 3ed9f07015
commit 077e78d37c
6 changed files with 329 additions and 0 deletions

View file

@ -42,6 +42,66 @@ Meteor.publish('boards', function() {
);
});
Meteor.publish('mySwimlanes', function() {
const userId = this.userId;
const swimlanes = [];
Cards.find({
archived: false,
$or: [{ members: userId }, { assignees: userId }],
}).forEach(card => {
swimlanes.push(card.swimlaneId);
});
return Swimlanes.find(
{
archived: false,
_id: { $in: swimlanes },
},
{
fields: {
_id: 1,
title: 1,
type: 1,
sort: 1,
},
// sort: {
// sort: ['boardId', 'listId', 'sort'],
// },
},
);
});
Meteor.publish('myLists', function() {
const userId = this.userId;
const lists = [];
Cards.find({
archived: false,
$or: [{ members: userId }, { assignees: userId }],
}).forEach(card => {
lists.push(card.listId);
});
return Lists.find(
{
archived: false,
_id: { $in: lists },
},
{
fields: {
_id: 1,
title: 1,
type: 1,
sort: 1,
},
// sort: {
// sort: ['boardId', 'listId', 'sort'],
// },
},
);
});
Meteor.publish('archivedBoards', function() {
const userId = this.userId;
if (!Match.test(userId, String)) return [];