summaryrefslogtreecommitdiffstats
path: root/client/components/rules/ruleDetails.js
blob: 385b0bae067124fd2e9d693c530810ad1c500f56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
BlazeComponent.extendComponent({
  onCreated() {
    this.subscribe('allRules');
    this.subscribe('allTriggers');
    this.subscribe('allActions');

  },

  trigger() {
    const ruleId = this.data().ruleId;
    const rule = Rules.findOne({
      _id: ruleId.get()
    });
    const trigger = Triggers.findOne({
      _id: rule.triggerId
    });
    console.log(trigger);
    return trigger.description();
  },
  action() {
    const ruleId = this.data().ruleId;
    const rule = Rules.findOne({
      _id: ruleId.get()
    });
    const action = Actions.findOne({
      _id: rule.actionId
    });
    console.log(action);
    return action.description();
  },

  events() {
    return [{}];
  },

}).register('ruleDetails');