summaryrefslogtreecommitdiffstats
path: root/client/config/blazeHelpers.js
blob: f3a1757fd897a92139e4f6d91ce1e65368dde5e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Blaze.registerHelper('currentBoard', () => {
  const boardId = Session.get('currentBoard');
  if (boardId) {
    return Boards.findOne(boardId);
  }
});

Blaze.registerHelper('currentCard', () => {
  const cardId = Session.get('currentCard');
  if (cardId) {
    return Cards.findOne(cardId);
  }
});

Blaze.registerHelper('getUser', (userId) => Users.findOne(userId));

Blaze.registerHelper('concat', function (...args) {
  return Array.prototype.slice.call(args, 0, -1).join('');
});