@@ -24,6 +24,7 @@ exports = module.exports = {
|
||||
setLabel,
|
||||
setTags,
|
||||
setIcon,
|
||||
setTurn,
|
||||
setMemoryLimit,
|
||||
setCpuShares,
|
||||
setAutomaticBackup,
|
||||
@@ -176,6 +177,8 @@ async function install(req, res, next) {
|
||||
if ('skipDnsSetup' in data && typeof data.skipDnsSetup !== 'boolean') return next(new HttpError(400, 'skipDnsSetup must be boolean'));
|
||||
if ('enableMailbox' in data && typeof data.enableMailbox !== 'boolean') return next(new HttpError(400, 'enableMailbox must be boolean'));
|
||||
|
||||
if ('enableTurn' in data && typeof data.enableTurn !== 'boolean') return next(new HttpError(400, 'enableTurn must be boolean'));
|
||||
|
||||
let [error, result] = await safe(apps.downloadManifest(data.appStoreId, data.manifest));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
@@ -407,6 +410,18 @@ async function setInbox(req, res, next) {
|
||||
next(new HttpSuccess(202, { taskId: result.taskId }));
|
||||
}
|
||||
|
||||
async function setTurn(req, res, next) {
|
||||
assert.strictEqual(typeof req.body, 'object');
|
||||
assert.strictEqual(typeof req.app, 'object');
|
||||
|
||||
if (typeof req.body.enable !== 'boolean') return next(new HttpError(400, 'enable must be a boolean'));
|
||||
|
||||
const [error, result] = await safe(apps.setTurn(req.app, req.body.enable, AuditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(202, { taskId: result.taskId }));
|
||||
}
|
||||
|
||||
async function setLocation(req, res, next) {
|
||||
assert.strictEqual(typeof req.body, 'object');
|
||||
assert.strictEqual(typeof req.app, 'object');
|
||||
|
||||
Reference in New Issue
Block a user