diff options
author | Nicu Tofan <nicu.tofan@gmail.com> | 2018-06-25 22:01:02 +0300 |
---|---|---|
committer | Nicu Tofan <nicu.tofan@gmail.com> | 2018-06-26 14:32:51 +0300 |
commit | 04745f0c2fe83f044032713e1864c5ac00d38ac9 (patch) | |
tree | 821d897115154a844e39cf085499995cb1562be1 /models | |
parent | aead18eb58e230ed06ac090f7ea36c64fd597992 (diff) | |
download | wekan-04745f0c2fe83f044032713e1864c5ac00d38ac9.tar.gz wekan-04745f0c2fe83f044032713e1864c5ac00d38ac9.tar.bz2 wekan-04745f0c2fe83f044032713e1864c5ac00d38ac9.zip |
implement getDefaultSwimline for boards
Diffstat (limited to 'models')
-rw-r--r-- | models/boards.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/models/boards.js b/models/boards.js index 6f0f7293..a8b7191e 100644 --- a/models/boards.js +++ b/models/boards.js @@ -337,6 +337,18 @@ Boards.helpers({ getDefaultSubtasksList() { return Lists.findOne(this.getDefaultSubtasksListId()); }, + + getDefaultSwimline() { + let result = Swimlanes.findOne({boardId: this._id}); + if (result === undefined) { + Swimlanes.insert({ + title: TAPi18n.__('default'), + boardId: this._id, + }); + result = Swimlanes.findOne({boardId: this._id}); + } + return result; + }, }); |