fix(server): move getModulesWithLocales call inside getLocale callback

This commit is contained in:
Melvin Chia
2026-01-21 15:57:26 +08:00
parent 272901abe1
commit 369cff0102

View File

@@ -32,8 +32,6 @@ function getModulesWithLocales(): string[] {
.map(dir => path.join(appsDir, dir))
}
const moduleApps = getModulesWithLocales()
const listLanguages = forge
.query()
.noAuth()
@@ -61,6 +59,8 @@ const getLocale = forge
})
})
.callback(async ({ query: { lang, namespace, subnamespace } }) => {
const moduleApps = getModulesWithLocales()
subnamespace = normalizeSubnamespace(subnamespace)
const finalLang = LocaleService.getAllowedLang().find(e =>