summaryrefslogtreecommitdiffstats
path: root/client/components/rules/actions/boardActions.js
blob: 53325ca0aca248b81a7307b873ff0ffe0c9fa006 (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
BlazeComponent.extendComponent({
  onCreated() {

  },



  events() {
    return [
    {'click .js-add-move-action'(event) {

      console.log(this.data());
      console.log(this.data().triggerIdVar.get());
      const ruleName = this.data().ruleName.get();
      const triggerId = this.data().triggerIdVar.get();
      const actionSelected = this.find('#action').value;

      if(actionSelected == "top"){
       Actions.insert({actionType: "moveCardToTop"},function(err,id){
        Rules.insert({title: ruleName, triggerId: triggerId, actionId: id});  
      });
     }
     if(actionSelected == "bottom"){
       Actions.insert({actionType: "moveCardToBottom"},function(err,id){
       Rules.insert({title: ruleName, triggerId: triggerId, actionId: id});  
      });
     }
   },
 }];
},

}).register('boardActions');