Mount API fixes

This commit is contained in:
Girish Ramakrishnan
2020-10-29 21:58:14 -07:00
parent fa4392df09
commit 65eae30a48
2 changed files with 3 additions and 3 deletions

View File

@@ -770,7 +770,7 @@ function setMounts(req, res, next) {
assert.strictEqual(typeof req.body, 'object');
assert.strictEqual(typeof req.resource, 'object');
if (Array.isArray(req.body.mounts)) return next(new HttpError(400, 'mounts should be an array'));
if (!Array.isArray(req.body.mounts)) return next(new HttpError(400, 'mounts should be an array'));
for (let m of req.body.mounts) {
if (!m || typeof m !== 'object') return next(new HttpError(400, 'mounts must be an object'));
if (typeof m.volumeId !== 'string') return next(new HttpError(400, 'volumeId must be a string'));