From 04745f0c2fe83f044032713e1864c5ac00d38ac9 Mon Sep 17 00:00:00 2001 From: Nicu Tofan Date: Mon, 25 Jun 2018 22:01:02 +0300 Subject: implement getDefaultSwimline for boards --- models/boards.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'models/boards.js') 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; + }, }); -- cgit v1.2.3-1-g7c22