fix(backend): Parse JSON as POJO before returning
This commit is contained in:
parent
6dbc6fe078
commit
f1ceea32f9
1 changed files with 10 additions and 1 deletions
|
@ -118,7 +118,16 @@ CuratedSetModel.prototype.allCuratedSets = async function () {
|
||||||
log.warn(`Failed to search curated sets: ${err}`)
|
log.warn(`Failed to search curated sets: ${err}`)
|
||||||
}
|
}
|
||||||
const list = []
|
const list = []
|
||||||
for (const curatedSet of curatedSets) list.push(curatedSet)
|
for (const curatedSet of curatedSets) {
|
||||||
|
// FIXME: Convert object to JSON. See https://github.com/prisma/prisma/issues/3786
|
||||||
|
const asPojo = { ...curatedSet }
|
||||||
|
asPojo.measies = JSON.parse(asPojo.measies)
|
||||||
|
for (const lang of this.config.languages) {
|
||||||
|
const key = `tags${capitalize(lang)}`
|
||||||
|
asPojo[key] = JSON.parse(asPojo[key] || [])
|
||||||
|
}
|
||||||
|
list.push(asPojo)
|
||||||
|
}
|
||||||
|
|
||||||
return list
|
return list
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue