wekan/server/publications/cards.js
John R. Supplee 077e78d37c My Cards development
first prototype
2020-12-31 19:14:55 +02:00

31 lines
583 B
JavaScript

Meteor.publish('card', cardId => {
check(cardId, String);
return Cards.find({ _id: cardId });
});
Meteor.publish('myCards', function() {
const userId = this.userId;
return Cards.find(
{
archived: false,
$or: [{ members: userId }, { assignees: userId }],
},
{
fields: {
_id: 1,
boardId: 1,
swimlaneId: 1,
listId: 1,
title: 1,
type: 1,
sort: 1,
members: 1,
assignees: 1,
},
// sort: {
// sort: ['boardId', 'listId', 'sort'],
// },
},
);
});