storage: make remove and removeDir async

This commit is contained in:
Girish Ramakrishnan
2022-04-14 16:07:01 -05:00
parent 8d8cdd38a9
commit 685bda35b9
7 changed files with 88 additions and 139 deletions
+5 -8
View File
@@ -119,24 +119,21 @@ function listDir(apiConfig, dir, batchSize, iteratorCallback, callback) {
callback(new BoxError(BoxError.NOT_IMPLEMENTED, 'listDir is not implemented'));
}
function remove(apiConfig, filename, callback) {
async function remove(apiConfig, filename) {
assert.strictEqual(typeof apiConfig, 'object');
assert.strictEqual(typeof filename, 'string');
assert.strictEqual(typeof callback, 'function');
// Result: none
callback(new BoxError(BoxError.NOT_IMPLEMENTED, 'remove is not implemented'));
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'remove is not implemented');
}
function removeDir(apiConfig, pathPrefix) {
async function removeDir(apiConfig, pathPrefix, progressCallback) {
assert.strictEqual(typeof apiConfig, 'object');
assert.strictEqual(typeof pathPrefix, 'string');
assert.strictEqual(typeof progressCallback, 'function');
// Result: none
var events = new EventEmitter();
process.nextTick(function () { events.emit('done', new BoxError(BoxError.NOT_IMPLEMENTED, 'removeDir is not implemented')); });
return events;
throw new BoxError(BoxError.NOT_IMPLEMENTED, 'removeDir is not implemented');
}
async function remount(apiConfig) {