Fork correctly
This commit is contained in:
@@ -148,6 +148,14 @@ module.exports = function (options) {
|
||||
where: {
|
||||
dialectId: dialect.id,
|
||||
}
|
||||
},
|
||||
{
|
||||
association: db.ArtifactVersion.Chapters,
|
||||
include: [
|
||||
{
|
||||
association: db.Chapter.Chunks
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
@@ -183,7 +191,21 @@ module.exports = function (options) {
|
||||
entityId: entityId,
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
translationChapters: artifactVersion.chapters.map(chapter => {
|
||||
return {
|
||||
creatorId: userId,
|
||||
chapterId: chapter.id,
|
||||
translationChunks: chapter.chunks.map(chunk => {
|
||||
return {
|
||||
creatorId: userId,
|
||||
chunkId: chunk.id,
|
||||
text: chunk.text,
|
||||
index: chunk.index
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}, {
|
||||
include: [
|
||||
{
|
||||
@@ -193,7 +215,15 @@ module.exports = function (options) {
|
||||
association: db.Owner.OwnerEntities
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
association: db.TranslationArtifactVersion.TranslationChapters,
|
||||
include: [
|
||||
{
|
||||
association: db.TranslationChapter.TranslationChunks
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
})
|
||||
} else {
|
||||
@@ -210,7 +240,21 @@ module.exports = function (options) {
|
||||
entityId: entityId,
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
translationChapters: artifactVersion.chapters.map(chapter => {
|
||||
return {
|
||||
creatorId: userId,
|
||||
chapterId: chapter.id,
|
||||
translationChunks: chapter.chunks.map(chunk => {
|
||||
return {
|
||||
creatorId: userId,
|
||||
chunkId: chunk.id,
|
||||
text: chunk.text,
|
||||
index: chunk.index
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}, {
|
||||
include: [
|
||||
{
|
||||
@@ -220,7 +264,15 @@ module.exports = function (options) {
|
||||
association: db.Owner.OwnerEntities
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
association: db.TranslationArtifactVersion.TranslationChapters,
|
||||
include: [
|
||||
{
|
||||
association: db.TranslationChapter.TranslationChunks
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user