merge appdb.js into apps.js

This commit is contained in:
Girish Ramakrishnan
2021-08-20 09:19:44 -07:00
parent b6f2d6d620
commit 77f5cb183b
39 changed files with 1599 additions and 2495 deletions

View File

@@ -275,14 +275,13 @@ async function updateDashboardDomain(req, res, next) {
next(new HttpSuccess(204, {}));
}
function prepareDashboardDomain(req, res, next) {
async function prepareDashboardDomain(req, res, next) {
if (!req.body.domain || typeof req.body.domain !== 'string') return next(new HttpError(400, 'domain must be a string'));
cloudron.prepareDashboardDomain(req.body.domain, auditSource.fromRequest(req), function (error, taskId) {
if (error) return next(BoxError.toHttpError(error));
const [error, taskId] = await safe(cloudron.prepareDashboardDomain(req.body.domain, auditSource.fromRequest(req)));
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(202, { taskId }));
});
next(new HttpSuccess(202, { taskId }));
}
async function renewCerts(req, res, next) {