misplaced await

This commit is contained in:
Girish Ramakrishnan
2021-05-12 13:30:22 -07:00
parent fc52cd7e0c
commit 52da431388
+1 -1
View File
@@ -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;