Исправлена функция обновления дерева

This commit is contained in:
Gnedov Pavel 2023-02-20 17:59:47 +07:00
parent 9568b12280
commit 82b63ef02e
2 changed files with 4 additions and 2 deletions

View file

@ -199,13 +199,13 @@ export class TreeIssuesStore {
data: RedmineTypes.Issue[],
): RedmineTypes.Issue[] {
if (!issue || !issue.children || issue.children.length <= 0) return;
data.push(issue);
for (let i = 0; i < issue.children.length; i++) {
const childIssueResult = this.getFlatStore().getIssue(
issue.children[i].id,
);
if (!childIssueResult || !childIssueResult.data) continue;
const childIssue = childIssueResult.data;
data.push(childIssue);
this.fillIssuesWithChildren(childIssue, data);
}
return data;

View file

@ -60,7 +60,9 @@ export class SimpleKanbanBoardController {
cfg.rootIssueId,
);
const issues = await this.issuesService.getIssuesWithChildren(rootIssue);
this.logger.debug(`Issues for tree refresh - ${issues}`); // DEBUG
const issuesIds = issues.map((i) => i.id);
this.logger.debug(`Issues for tree refresh - ${issuesIds}`);
this.redmineEventsGateway.addIssues(issuesIds);
return { success: true };
}