diff options
author | Angelo Gallarello <angelo.gallarell@gmail.com> | 2019-02-12 23:40:12 +0100 |
---|---|---|
committer | Angelo Gallarello <angelo.gallarell@gmail.com> | 2019-02-12 23:40:12 +0100 |
commit | 477d71e0b90d15b54945a1a04cb0a649344075ae (patch) | |
tree | 3eccde9b00ff3d35b98e960cbb755c177ee14bda /models/import.js | |
parent | d22964bcfd46ea4fd4860528b0c5e6f5d90812b6 (diff) | |
download | wekan-477d71e0b90d15b54945a1a04cb0a649344075ae.tar.gz wekan-477d71e0b90d15b54945a1a04cb0a649344075ae.tar.bz2 wekan-477d71e0b90d15b54945a1a04cb0a649344075ae.zip |
Fixes
Diffstat (limited to 'models/import.js')
-rw-r--r-- | models/import.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/models/import.js b/models/import.js index 5cdf8dc1..c73959b7 100644 --- a/models/import.js +++ b/models/import.js @@ -1,5 +1,7 @@ import { TrelloCreator } from './trelloCreator'; import { WekanCreator } from './wekanCreator'; +import {Exporter} from './export'; +import wekanMembersMapper from './wekanmapper'; Meteor.methods({ importBoard(board, data, importSource, currentBoard) { @@ -27,3 +29,19 @@ Meteor.methods({ return creator.create(board, currentBoard); }, }); + +Meteor.methods({ + cloneBoard(sourceBoardId,currentBoardId) { + check(sourceBoardId, String); + check(currentBoardId, Match.Maybe(String)); + const exporter = new Exporter(sourceBoardId); + let data = exporter.build(); + let addData = {}; + addData.membersMapping = wekanMembersMapper.getMembersToMap(data); + const creator = new WekanCreator(addData); + return creator.create(data, currentBoardId); + }, +}); + + + |