feat: core improvements + local fs provider + UI fixes

This commit is contained in:
NGPixel
2018-07-29 22:23:33 -04:00
parent 803d86ff63
commit 2817c72ec3
65 changed files with 482 additions and 264 deletions

View File

@@ -6,16 +6,16 @@ const gql = require('graphql')
module.exports = {
Query: {
rights(obj, args, context, info) {
return WIKI.db.Right.findAll({ where: args })
return WIKI.models.Right.findAll({ where: args })
}
},
Mutation: {
addRightToGroup(obj, args) {
return WIKI.db.Group.findById(args.groupId).then(grp => {
return WIKI.models.Group.findById(args.groupId).then(grp => {
if (!grp) {
throw new gql.GraphQLError('Invalid Group ID')
}
return WIKI.db.Right.create({
return WIKI.models.Right.create({
path: args.path,
role: args.role,
exact: args.exact,
@@ -25,7 +25,7 @@ module.exports = {
})
},
removeRightFromGroup(obj, args) {
return WIKI.db.Right.destroy({
return WIKI.models.Right.destroy({
where: {
id: args.rightId
},
@@ -33,7 +33,7 @@ module.exports = {
})
},
modifyRight(obj, args) {
return WIKI.db.Right.update({
return WIKI.models.Right.update({
path: args.path,
role: args.role,
exact: args.exact,