Skip to content

Commit

Permalink
EW-539 Add ComponentType Lernstore to cc-export-service
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoneRadtke-Cap committed Oct 27, 2023
1 parent 3e112cc commit ed2d219
Showing 1 changed file with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { LessonService } from '@modules/lesson/service';
import { TaskService } from '@modules/task/service';
import { Injectable } from '@nestjs/common';
import { Course, EntityId, IComponentProperties, Task } from '@shared/domain';
import { LessonService } from '@modules/lesson/service';
import { ComponentType } from '@src/shared/domain/entity/lesson.entity';
import { TaskService } from '@modules/task/service';
import {
CommonCartridgeFileBuilder,
CommonCartridgeIntendedUseType,
Expand All @@ -11,8 +11,8 @@ import {
ICommonCartridgeResourceProps,
ICommonCartridgeWebContentResourceProps,
} from '../common-cartridge';
import { CourseService } from './course.service';
import { createIdentifier } from '../common-cartridge/utils';
import { CourseService } from './course.service';

@Injectable()
export class CommonCartridgeExportService {
Expand Down Expand Up @@ -129,6 +129,21 @@ export class CommonCartridgeExportService {
};
}

if (content.component === ComponentType.LERNSTORE) {
if (content.content && Array.isArray(content.content.resources) && content.content.resources.length > 0) {
content.content.resources.map((resource) => {
return {
...commonProps,
type:
version === CommonCartridgeVersion.V_1_3_0
? CommonCartridgeResourceType.WEB_LINK_V3
: CommonCartridgeResourceType.WEB_LINK_V1,
url: resource.url,
};
});
}
}

return undefined;
}

Expand Down

0 comments on commit ed2d219

Please sign in to comment.