Add new file creation action and collapse new and upload actions

This commit is contained in:
Johannes Zellner
2020-10-22 10:25:50 +02:00
parent 210d522ec3
commit f586791c71
3 changed files with 85 additions and 5 deletions

View File

@@ -2621,6 +2621,15 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
});
};
Client.prototype.filesCreateFile = function (appId, path, callback) {
post('/api/v1/apps/' + appId + '/files/' + path, {}, {}, function (error, data, status) {
if (error) return callback(error);
if (status !== 200) return callback(new ClientError(status, data));
callback(null, data);
});
};
Client.prototype.filesUpload = function (appId, path, file, progressHandler, callback) {
var fd = new FormData();
fd.append('file', file);