Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions api/src/modules/translations/services/translations.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,19 @@ export class TranslationsService implements OnApplicationBootstrap {
}

public async getLanguages(): Promise<LanguageInfo[]> {
const response = await this.dataService.execute<GetAllLanguagesQuery>(GetAllLanguagesDocument);
return response.lookup_languages.map(
(language): LanguageInfo => ({
languageCode: language.value,
languageLabel: language.comment,
})
return this.cacheManager.wrap(
'LANGUAGES',
async () => {
const response =
await this.dataService.execute<GetAllLanguagesQuery>(GetAllLanguagesDocument);
return response.lookup_languages.map(
(language): LanguageInfo => ({
languageCode: language.value,
languageLabel: language.comment,
})
);
},
86_400_000 // 24 hours
);
}

Expand Down