Skip to content

Commit

Permalink
Added implementation of feature flag.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaellinaresxk committed Nov 27, 2023
1 parent f154f3c commit 654f926
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions apps/server/src/modules/lesson/service/lesson-copy.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,17 +225,25 @@ export class LessonCopyService {
copiedContentStatus.push(embeddedTaskStatus);
}
if (element.component === ComponentType.NEXBOARD && nexboardEnabled) {
// eslint-disable-next-line no-await-in-loop
const nexboardContent = await this.copyNexboard(element, params);
const nexboardStatus = {
let nexboardStatus = {
title: element.title,
type: CopyElementType.LESSON_CONTENT_NEXBOARD,
status: CopyStatusEnum.PARTIAL,
};
if (nexboardContent) {
copiedContent.push(nexboardContent);
} else {
nexboardStatus.status = CopyStatusEnum.FAIL;
if (!copyNexboardEnabled) {
nexboardStatus.status = CopyStatusEnum.NOT_DOING;
}
if (nexboardStatus.status === CopyStatusEnum.PARTIAL) {
try {
const nexboardContent = await this.copyNexboard(element, params);
if (nexboardContent) {
copiedContent.push(nexboardContent);
} else {
nexboardStatus.status = CopyStatusEnum.NOT_DOING;
}
} catch (error) {
nexboardStatus.status = CopyStatusEnum.NOT_DOING;
}
}
copiedContentStatus.push(nexboardStatus);
}
Expand Down

0 comments on commit 654f926

Please sign in to comment.