Skip to content

Commit

Permalink
Removed embedded items
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenwf committed Nov 8, 2022
1 parent b175023 commit c62e5d2
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/annotation-page-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,11 @@ export class AnnotationPageInstanceBuilder extends BaseEntityBuilder<AnnotationP

createAnnotation(annotation: Annotation) {
// Extract annotation body + target as reference

if (this.defaultAnnotationTarget && !annotation.target) {
annotation.target = this.defaultAnnotationTarget;
}

const [annotationRef] = this.importRawJson<'Annotation'>(annotation);

//
//
// const body = Array.isArray(annotation.body) ? annotation.body : [annotation.body];
//
// annotation.body = body.map((singleBody) => {
// if (singleBody && (singleBody as ChoiceBody).type === 'Choice') {
// const choiceBody = singleBody as ChoiceBody;
// choiceBody.items = choiceBody.items.map((choiceItem) => {
// return this.addEmbeddedInstance(choiceItem, 'ContentResource');
// });
// return this.addEmbeddedInstance(choiceBody, 'ContentResource');
// }
//
// return this.addEmbeddedInstance(singleBody, 'ContentResource');
// });
//
// const annotationRef = this.addEmbeddedInstance(annotation, 'Annotation');

this.modified.add('items');
this.entity.items = [...this.entity.items, annotationRef];
}
Expand Down

0 comments on commit c62e5d2

Please sign in to comment.