move unarchive to apps model
This commit is contained in:
@@ -10,7 +10,8 @@ exports = module.exports = {
|
||||
unarchive
|
||||
};
|
||||
|
||||
const assert = require('assert'),
|
||||
const apps = require('../apps.js'),
|
||||
assert = require('assert'),
|
||||
archives = require('../archives.js'),
|
||||
AuditSource = require('../auditsource.js'),
|
||||
BoxError = require('../boxerror.js'),
|
||||
@@ -88,7 +89,7 @@ async function unarchive(req, res, next) {
|
||||
if (Object.keys(data.secondaryDomains).some(function (key) { return typeof data.secondaryDomains[key].domain !== 'string' || typeof data.secondaryDomains[key].subdomain !== 'string'; })) return next(new HttpError(400, 'secondaryDomain object must contain domain and subdomain strings'));
|
||||
}
|
||||
|
||||
const [error, result] = await safe(archives.unarchive(req.resource, req.body, AuditSource.fromRequest(req)));
|
||||
const [error, result] = await safe(apps.unarchive(req.resource, req.body, AuditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(202, { id: result.id, taskId: result.taskId }));
|
||||
|
||||
Reference in New Issue
Block a user