misplaced await
This commit is contained in:
@@ -19,7 +19,7 @@ const assert = require('assert'),
|
||||
async function load(req, res, next) {
|
||||
assert.strictEqual(typeof req.params.id, 'string');
|
||||
|
||||
const [error, result] = safe(await volumes.get(req.params.id));
|
||||
const [error, result] = await safe(volumes.get(req.params.id));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
if (!result) return next(new HttpError(404, 'Volume not found'));
|
||||
req.resource = result;
|
||||
|
||||
Reference in New Issue
Block a user