refactor: global namespace + admin pages UI

This commit is contained in:
NGPixel
2018-03-05 15:49:36 -05:00
parent f203173c6c
commit 7acc4e9fed
61 changed files with 751 additions and 508 deletions

View File

@@ -0,0 +1,24 @@
/* global WIKI */
const _ = require('lodash')
module.exports = {
Query: {
settings(obj, args, context, info) {
return WIKI.db.Setting.findAll({ where: args, raw: true }).then(entries => {
return _.map(entries, entry => {
entry.config = JSON.stringify(entry.config)
return entry
})
})
}
},
Mutation: {
setConfigEntry(obj, args) {
return WIKI.db.Setting.update({
value: args.value
}, { where: { key: args.key } })
}
}
}