translation: asyncify
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user