mirror of
https://github.com/wekan/wekan.git
synced 2025-12-29 13:48:49 +01:00
Fixed Wekan JSON import fails.
Thanks to BartoszBroda and xet7 ! Fixes #3918
This commit is contained in:
parent
6d73618a48
commit
0fa8fc8b50
1 changed files with 15 additions and 11 deletions
|
|
@ -271,17 +271,21 @@ export class WekanCreator {
|
|||
});
|
||||
});
|
||||
}
|
||||
boardToImport.labels.forEach(label => {
|
||||
const labelToCreate = {
|
||||
_id: Random.id(6),
|
||||
color: label.color,
|
||||
name: label.name,
|
||||
};
|
||||
// We need to remember them by Wekan ID, as this is the only ref we have
|
||||
// when importing cards.
|
||||
this.labels[label._id] = labelToCreate._id;
|
||||
boardToCreate.labels.push(labelToCreate);
|
||||
});
|
||||
|
||||
if (boardToImport.labels) {
|
||||
boardToImport.labels.forEach(label => {
|
||||
const labelToCreate = {
|
||||
_id: Random.id(6),
|
||||
color: label.color,
|
||||
name: label.name,
|
||||
};
|
||||
// We need to remember them by Wekan ID, as this is the only ref we have
|
||||
// when importing cards.
|
||||
this.labels[label._id] = labelToCreate._id;
|
||||
boardToCreate.labels.push(labelToCreate);
|
||||
});
|
||||
}
|
||||
|
||||
const boardId = Boards.direct.insert(boardToCreate);
|
||||
Boards.direct.update(boardId, {
|
||||
$set: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue