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,35 @@
/* global WIKI */
module.exports = {
Query: {
folders(obj, args, context, info) {
return WIKI.db.Folder.findAll({ where: args })
}
},
Mutation: {
createFolder(obj, args) {
return WIKI.db.Folder.create(args)
},
deleteGroup(obj, args) {
return WIKI.db.Folder.destroy({
where: {
id: args.id
},
limit: 1
})
},
renameFolder(obj, args) {
return WIKI.db.Folder.update({
name: args.name
}, {
where: { id: args.id }
})
}
},
Folder: {
files(grp) {
return grp.getFiles()
}
}
}