install/unarchive: add support for various fields
This commit is contained in:
@@ -185,6 +185,9 @@ async function install(req, res, next) {
|
||||
|
||||
if ('enableTurn' in data && typeof data.enableTurn !== 'boolean') return next(new HttpError(400, 'enableTurn must be boolean'));
|
||||
|
||||
if ('cpuQuota' in data && data.cpuQuota !== 'number') return next(new HttpError(400, 'cpuQuota is not a number'));
|
||||
if ('operators' in req.body && typeof req.body.operators !== 'object') return next(new HttpError(400, 'operators must be an object'));
|
||||
|
||||
let [error, result] = await safe(appstore.downloadManifest(data.appStoreId, data.manifest));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
@@ -195,6 +198,8 @@ async function install(req, res, next) {
|
||||
data.appStoreId = result.appStoreId;
|
||||
data.manifest = result.manifest;
|
||||
|
||||
delete data.archive; // internally used for archive code path
|
||||
|
||||
[error, result] = await safe(apps.install(data, AuditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user