summaryrefslogtreecommitdiffstats
path: root/models/import.js
diff options
context:
space:
mode:
Diffstat (limited to 'models/import.js')
-rw-r--r--models/import.js18
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);
+ },
+});
+
+
+