Skip to content
Snippets Groups Projects
Commit 6a40dead authored by Alexandru Munteanu's avatar Alexandru Munteanu
Browse files

feat(technical-checks): create token on submit

parent 574dd8b2
No related branches found
No related tags found
2 merge requests!21Sprint #16 features,!16Eqs decision
......@@ -2,5 +2,6 @@ module.exports = {
backend: () => app => {
require('./src/FragmentsRecommendations')(app)
require('./src/Fragments')(app)
require('./src/TechnicalChecks')(app)
},
}
const { v4 } = require('uuid')
const config = require('config')
const { get } = require('lodash')
const { get, set } = require('lodash')
const {
Email,
Fragment,
......@@ -54,7 +55,8 @@ module.exports = models => async (req, res) => {
})
email.setupManuscriptSubmittedEmail()
collection.status = 'submitted'
collection.status = 'technicalChecks'
set(collection, 'technicalChecks.token', v4())
collection.save()
const { journal, xmlParser, ftp } = mtsConfig
......
......@@ -38,6 +38,8 @@ module.exports = ({ Collection }) => async (req, res) => {
collection.status = setNewStatus(step, agree)
await collection.save()
// TODO: send email to EiC here
return res.status(200).json(collection)
} catch (e) {
const notFoundError = await services.handleNotFoundError(e, 'Item')
......
......@@ -11,6 +11,9 @@ module.exports = {
customId: Joi.string(),
invitations: Joi.array(),
handlingEditor: Joi.object(),
technicalChecks: Joi.object({
token: Joi.string(),
}),
},
fragment: [
{
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment