use list pattern when listing

This commit is contained in:
Girish Ramakrishnan
2023-08-10 16:20:33 +05:30
parent d3b58483bd
commit 9ba6908764
4 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -13,7 +13,7 @@ exports = module.exports = {
getPlatformStatus,
getLanguages,
listLanguages,
getLanguage,
setLanguage,
@@ -157,8 +157,8 @@ async function prepareDashboardDomain(req, res, next) {
next(new HttpSuccess(202, { taskId }));
}
async function getLanguages(req, res, next) {
const [error, languages] = await safe(translation.getLanguages());
async function listLanguages(req, res, next) {
const [error, languages] = await safe(translation.listLanguages());
if (error) return next(new BoxError.toHttpError(error));
next(new HttpSuccess(200, { languages }));