translation: asyncify

This commit is contained in:
Girish Ramakrishnan
2021-08-19 11:00:35 -07:00
parent 03e22170da
commit ada7166bf8
5 changed files with 102 additions and 132 deletions

View File

@@ -311,12 +311,11 @@ function getServerIp(req, res, next) {
});
}
function getLanguages(req, res, next) {
translation.getLanguages(function (error, languages) {
if (error) return next(new BoxError.toHttpError(error));
async function getLanguages(req, res, next) {
const [error, languages] = await safe(translation.getLanguages());
if (error) return next(new BoxError.toHttpError(error));
next(new HttpSuccess(200, { languages }));
});
next(new HttpSuccess(200, { languages }));
}
async function syncDnsRecords(req, res, next) {