Filter by translator
This commit is contained in:
@@ -1149,20 +1149,7 @@ module.exports = function (options) {
|
|||||||
]
|
]
|
||||||
}).then(async (project) => {
|
}).then(async (project) => {
|
||||||
if (project) {
|
if (project) {
|
||||||
db.TranslationChapter.findAll({
|
const translationChapterTranslatorInclude = {
|
||||||
include: [
|
|
||||||
{
|
|
||||||
association: db.TranslationChapter.Chapter,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
association: db.TranslationChapter.TranslationChunks,
|
|
||||||
include: [
|
|
||||||
{
|
|
||||||
association: db.TranslationChunk.Translation
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
association: db.TranslationChapter.TranslationChapterTranslators,
|
association: db.TranslationChapter.TranslationChapterTranslators,
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
@@ -1179,7 +1166,29 @@ module.exports = function (options) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
}
|
||||||
|
if (request.query.translatorId) {
|
||||||
|
translationChapterTranslatorInclude.required = true
|
||||||
|
translationChapterTranslatorInclude.include[0].required = true
|
||||||
|
translationChapterTranslatorInclude.include[0].where = {
|
||||||
|
id: request.query.translatorId
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
db.TranslationChapter.findAll({
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.TranslationChapter.Chapter,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
association: db.TranslationChapter.TranslationChunks,
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
association: db.TranslationChunk.Translation
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
translationChapterTranslatorInclude,
|
||||||
{
|
{
|
||||||
association: db.TranslationChapter.TranslationChapterProofReaders,
|
association: db.TranslationChapter.TranslationChapterProofReaders,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user