Return data on client (sync) and Promise on server (async) naturally, without wrapping in an extra Promise

This commit is contained in:
Harry Adel 2026-02-18 18:24:55 +02:00
parent 2b15a8ff09
commit f934aea2a5
21 changed files with 405 additions and 3760 deletions

View file

@ -181,7 +181,7 @@ export class TrelloCreator {
}
// You must call parseActions before calling this one.
createBoardAndLabels(trelloBoard) {
async createBoardAndLabels(trelloBoard) {
let color = 'blue';
if (this.getColor(trelloBoard.prefs.background) !== undefined) {
color = this.getColor(trelloBoard.prefs.background);
@ -207,7 +207,7 @@ export class TrelloCreator {
permission: this.getPermission(trelloBoard.prefs.permissionLevel),
slug: getSlug(trelloBoard.name) || 'board',
stars: 0,
title: Boards.uniqueTitle(trelloBoard.name),
title: await Boards.uniqueTitle(trelloBoard.name),
};
// now add other members
if (trelloBoard.memberships) {
@ -779,7 +779,7 @@ export class TrelloCreator {
await currentBoard.archive();
}
this.parseActions(board.actions);
const boardId = this.createBoardAndLabels(board);
const boardId = await this.createBoardAndLabels(board);
this.createLists(board.lists, boardId);
this.createSwimlanes(boardId);
this.createCards(board.cards, boardId);