updated private cloud functions
This commit is contained in:
@@ -233,26 +233,6 @@ exports.searchRemoteIndexes = function (req, res) {
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* function : Download remote binary by post request
|
||||
* parameter : remote index ID
|
||||
* return : Redirect to binary download
|
||||
*/
|
||||
exports.downloadIndex = function (req, res) {
|
||||
let remoteIndexID = req.body.index_id;
|
||||
|
||||
internalLogic.downloadRemoteBinCachedWorkUnit(remoteIndexID, function (serveBinErr, filePath) {
|
||||
if (errorCode.SUCCESS.code === serveBinErr.code) {
|
||||
logger.info("download file located at " + filePath);
|
||||
res.download(filePath, "");
|
||||
} else {
|
||||
logger.info("download file failed");
|
||||
res.write('');
|
||||
res.end();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* function : Download remote binary
|
||||
* parameter : remote index ID
|
||||
@@ -260,8 +240,10 @@ exports.downloadIndex = function (req, res) {
|
||||
*/
|
||||
exports.downloadRemoteIndex = function (req, res) {
|
||||
let remoteIndexID = req.query.remote_index_id;
|
||||
let adminId = req.query.admin_id;
|
||||
let token = req.query.token;
|
||||
|
||||
internalLogic.downloadRemoteBinCachedWorkUnit(remoteIndexID, function (serveBinErr, filePath) {
|
||||
internalLogic.downloadRemoteBinCachedWorkUnit(adminId, token, remoteIndexID, function (serveBinErr, filePath) {
|
||||
if (errorCode.SUCCESS.code === serveBinErr.code) {
|
||||
logger.info("download file located at " + filePath);
|
||||
res.download(filePath, "");
|
||||
|
||||
Reference in New Issue
Block a user