fix(xo-server/jobs): serialize all fields

Otherwise some strings containing valid JSON syntax are incorrectly
transformed.
This commit is contained in:
Julien Fontanet 2018-07-19 10:14:51 +02:00
parent a1c829e393
commit d51527b2d8

View File

@ -90,10 +90,7 @@ const normalize = job => {
const serialize = (job: {| [string]: any |}) => {
Object.keys(job).forEach(key => {
const value = job[key]
if (typeof value !== 'string') {
job[key] = JSON.stringify(job[key])
}
job[key] = JSON.stringify(job[key])
})
return job
}