Use the copyBoard method to duplicate a board

* Use `copyBoard` instead of `cloneBoard` to duplicate a board
* Give duplicated boards a unique title by appending number
This commit is contained in:
John R. Supplee 2021-01-22 14:24:39 +02:00
parent ff8a36653a
commit b249fcbb2e
3 changed files with 28 additions and 3 deletions

View file

@ -124,9 +124,13 @@ BlazeComponent.extendComponent({
},
'click .js-clone-board'(evt) {
Meteor.call(
'cloneBoard',
'copyBoard',
this.currentData()._id,
Session.get('fromBoard'),
{
sort: Boards.find({ archived: false }).count(),
type: 'board',
title: Boards.findOne(this.currentData()._id).copyTitle(),
},
(err, res) => {
if (err) {
this.setError(err.error);

View file

@ -687,7 +687,6 @@ BlazeComponent.extendComponent({
_id = data;
},
);
// _id = board.copy();
}
Popup.close();
},