filemanager: implement copy for files

This commit is contained in:
Johannes Zellner
2021-02-01 16:45:55 +01:00
parent 436c54b829
commit 2935fa6a36
2 changed files with 26 additions and 0 deletions

View File

@@ -2815,6 +2815,17 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
});
};
Client.prototype.filesCopy = function (id, type, path, newPath, callback) {
var objpath = (type === 'app' ? 'apps/' : 'volumes/') + id;
put('/api/v1/' + objpath + '/files/' + path, { action: 'copy', newFilePath: newPath }, {}, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
callback(null, data);
});
};
Client.prototype.filesCreateDirectory = function (id, type, path, callback) {
var objpath = (type === 'app' ? 'apps/' : 'volumes/') + id;