mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-19 19:21:33 +10:00
release: v4.1.0
This commit is contained in:
@ -1,21 +1,13 @@
|
||||
import { Controller, Get } from "@nestjs/common";
|
||||
|
||||
import { UtilsService } from "../utils/utils.service";
|
||||
import { TranslationService } from "./translation.service";
|
||||
|
||||
@Controller("translation")
|
||||
export class TranslationController {
|
||||
constructor(
|
||||
private readonly translationService: TranslationService,
|
||||
private readonly utils: UtilsService,
|
||||
) {}
|
||||
constructor(private readonly translationService: TranslationService) {}
|
||||
|
||||
@Get("/languages")
|
||||
async languages() {
|
||||
return this.utils.getCachedOrSet(
|
||||
`translation:languages`,
|
||||
async () => this.translationService.fetchLanguages(),
|
||||
1000 * 60 * 60 * 24, // 24 hours
|
||||
);
|
||||
return this.translationService.fetchLanguages();
|
||||
}
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ export class TranslationService {
|
||||
locale: data.language.locale,
|
||||
} satisfies Language;
|
||||
});
|
||||
} catch (error) {
|
||||
} catch {
|
||||
return languages;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user