Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
router.get('/admin', (req, res) => {
const EditorJSONPromise = new Editor()
.orderBy('name')
.fetchAll()
.then((editors) => {
return editors.map((editor) => {
const editorJSON = editor.toJSON();
return {
id: editorJSON.id,
name: editorJSON.name
}
});
});
const AchievementJSONPromise = new AchievementType()
.orderBy('name')
.fetchAll()
.then((achievements) => {
const achievementList = achievements.toJSON();
achievementList.unshift({id: 'none', name: 'No Achievement'});
console.log(achievementList);
return achievementList;
});
const TitleJSONPromise = new TitleType()
.orderBy('title')
.fetchAll()
.then((titles) => {
const titleList = titles.toJSON();
titleList.unshift({id: 'none', title: 'No Title'});
return titleList;