Create a campaign for a translation
This commit is contained in:
@@ -12,11 +12,49 @@ module.exports = function (options) {
|
||||
})
|
||||
})
|
||||
|
||||
router.route('/create')
|
||||
.post(function(request, response, next) {
|
||||
console.log(request.body)
|
||||
next()
|
||||
router.route('/:id')
|
||||
.get(function(request, response, next) {
|
||||
db.Campaign.findByPk(request.params.id, {
|
||||
include: [
|
||||
{
|
||||
association: db.Campaign.TranslationArtifactVersionCampaigns,
|
||||
include: [
|
||||
{
|
||||
association: db.TranslationArtifactVersionCampaign.TranslationArtifactVersion,
|
||||
include: [
|
||||
{
|
||||
association: db.TranslationArtifactVersion.ArtifactVersion,
|
||||
include: [
|
||||
{
|
||||
association: db.ArtifactVersion.Artifact
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}).then(campaign => {
|
||||
if (campaign) {
|
||||
response.display("campaign", {
|
||||
user: request.user,
|
||||
pageTitle: "Campaign - Mantra",
|
||||
campaign: campaign
|
||||
})
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
}).catch(error => {
|
||||
next(error)
|
||||
})
|
||||
})
|
||||
|
||||
// router.route('/create')
|
||||
// .post(function(request, response, next) {
|
||||
// console.log(request.body)
|
||||
// next()
|
||||
// })
|
||||
|
||||
return router;
|
||||
};
|
||||
Reference in New Issue
Block a user