mirror of https://github.com/requarks/wiki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
618 B
36 lines
618 B
7 years ago
|
|
||
7 years ago
|
/* global WIKI */
|
||
7 years ago
|
|
||
|
module.exports = {
|
||
|
Query: {
|
||
|
folders(obj, args, context, info) {
|
||
7 years ago
|
return WIKI.db.Folder.findAll({ where: args })
|
||
7 years ago
|
}
|
||
|
},
|
||
|
Mutation: {
|
||
|
createFolder(obj, args) {
|
||
7 years ago
|
return WIKI.db.Folder.create(args)
|
||
7 years ago
|
},
|
||
|
deleteGroup(obj, args) {
|
||
7 years ago
|
return WIKI.db.Folder.destroy({
|
||
7 years ago
|
where: {
|
||
|
id: args.id
|
||
|
},
|
||
|
limit: 1
|
||
|
})
|
||
7 years ago
|
},
|
||
|
renameFolder(obj, args) {
|
||
7 years ago
|
return WIKI.db.Folder.update({
|
||
7 years ago
|
name: args.name
|
||
|
}, {
|
||
|
where: { id: args.id }
|
||
|
})
|
||
7 years ago
|
}
|
||
|
},
|
||
|
Folder: {
|
||
|
files(grp) {
|
||
|
return grp.getFiles()
|
||
|
}
|
||
|
}
|
||
|
}
|