feat: core improvements + local fs provider + UI fixes
This commit is contained in:
@@ -6,16 +6,16 @@ const gql = require('graphql')
|
||||
module.exports = {
|
||||
Query: {
|
||||
files(obj, args, context, info) {
|
||||
return WIKI.db.File.findAll({ where: args })
|
||||
return WIKI.models.File.findAll({ where: args })
|
||||
}
|
||||
},
|
||||
Mutation: {
|
||||
uploadFile(obj, args) {
|
||||
// todo
|
||||
return WIKI.db.File.create(args)
|
||||
return WIKI.models.File.create(args)
|
||||
},
|
||||
deleteFile(obj, args) {
|
||||
return WIKI.db.File.destroy({
|
||||
return WIKI.models.File.destroy({
|
||||
where: {
|
||||
id: args.id
|
||||
},
|
||||
@@ -23,18 +23,18 @@ module.exports = {
|
||||
})
|
||||
},
|
||||
renameFile(obj, args) {
|
||||
return WIKI.db.File.update({
|
||||
return WIKI.models.File.update({
|
||||
filename: args.filename
|
||||
}, {
|
||||
where: { id: args.id }
|
||||
})
|
||||
},
|
||||
moveFile(obj, args) {
|
||||
return WIKI.db.File.findById(args.fileId).then(fl => {
|
||||
return WIKI.models.File.findById(args.fileId).then(fl => {
|
||||
if (!fl) {
|
||||
throw new gql.GraphQLError('Invalid File ID')
|
||||
}
|
||||
return WIKI.db.Folder.findById(args.folderId).then(fld => {
|
||||
return WIKI.models.Folder.findById(args.folderId).then(fld => {
|
||||
if (!fld) {
|
||||
throw new gql.GraphQLError('Invalid Folder ID')
|
||||
}
|
||||
|
Reference in New Issue
Block a user