Skip to content

Commit

Permalink
Fix: run update on course data with original data to load course.json…
Browse files Browse the repository at this point in the history
… extension settings (fixes #53) (#54)
  • Loading branch information
taylortom authored Sep 9, 2024
2 parents 64bc76f + cc6bb89 commit ee10920
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/AdaptFrameworkImport.js
Original file line number Diff line number Diff line change
Expand Up @@ -508,9 +508,8 @@ class AdaptFrameworkImport {
const course = await this.importContentObject({ ...this.contentJson.course, tags: this.tags })
const config = await this.importContentObject(this.contentJson.config)
// we need to run an update with the same data to make sure all extension schema settings are applied
await Promise.all([course, config].map(({ _id, _type, _courseId }) => {
return this.importContentObject({ _id, _courseId }, { isUpdate: true })
}))
await this.importContentObject({ ...this.contentJson.course, _id: course._id }, { isUpdate: true })

const { sorted, hierarchy } = await this.getSortedData()
const errors = []
for (const ids of sorted) {
Expand Down

0 comments on commit ee10920

Please sign in to comment.