mirror of
https://github.com/wekan/wekan.git
synced 2026-01-03 08:08:49 +01:00
Use a Meteor call to copy a board
The current method was to copy a board on the client side. But not all data was available for copying rules. Moving the copy function to the server side solves this problem.
This commit is contained in:
parent
1c7a9e4de8
commit
ff8a36653a
3 changed files with 30 additions and 6 deletions
|
|
@ -209,3 +209,19 @@ Meteor.publishRelations('board', function(boardId, isArchived) {
|
|||
|
||||
return this.ready();
|
||||
});
|
||||
|
||||
Meteor.methods({
|
||||
copyBoard(boardId, properties) {
|
||||
check(boardId, String);
|
||||
check(properties, Object);
|
||||
|
||||
const board = Boards.findOne(boardId);
|
||||
if (board) {
|
||||
for (const key in properties) {
|
||||
board[key] = properties[key];
|
||||
}
|
||||
return board.copy();
|
||||
}
|
||||
return null;
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue