summaryrefslogtreecommitdiffstats
path: root/models/boards.js
diff options
context:
space:
mode:
authorXavier Priour <xavier.priour@bubblyware.com>2015-10-19 20:14:29 +0200
committerXavier Priour <xavier.priour@bubblyware.com>2015-10-19 20:14:29 +0200
commit8e0ad9119190ac0cfa22827fa278b498eba02d6c (patch)
tree27b720f8a26f5b94ccb54165dff5769f9c241943 /models/boards.js
parentec304de811d41f2679fc8ef171c0884db8bc9014 (diff)
downloadwekan-8e0ad9119190ac0cfa22827fa278b498eba02d6c.tar.gz
wekan-8e0ad9119190ac0cfa22827fa278b498eba02d6c.tar.bz2
wekan-8e0ad9119190ac0cfa22827fa278b498eba02d6c.zip
Import board: map team permission, and refactor code to share with card import
Diffstat (limited to 'models/boards.js')
-rw-r--r--models/boards.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/models/boards.js b/models/boards.js
index fd0212c5..e42e06c6 100644
--- a/models/boards.js
+++ b/models/boards.js
@@ -111,6 +111,14 @@ Boards.helpers({
colorClass() {
return `board-color-${this.color}`;
},
+
+ // XXX currently mutations return no value so we have an issue when using addLabel in import
+ // XXX waiting on https://github.com/mquandalle/meteor-collection-mutations/issues/1 to remove...
+ pushLabel(name, color) {
+ const _id = Random.id(6);
+ Boards.direct.update(this._id, { $push: {labels: { _id, name, color }}});
+ return _id;
+ },
});
Boards.mutations({