mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-21 04:01:41 +10:00
release: v4.1.0
This commit is contained in:
@ -1,30 +1,18 @@
|
||||
import { Controller, Get } from "@nestjs/common";
|
||||
|
||||
import { UtilsService } from "../utils/utils.service";
|
||||
import { ContributorsService } from "./contributors.service";
|
||||
|
||||
@Controller("contributors")
|
||||
export class ContributorsController {
|
||||
constructor(
|
||||
private readonly contributorsService: ContributorsService,
|
||||
private readonly utils: UtilsService,
|
||||
) {}
|
||||
constructor(private readonly contributorsService: ContributorsService) {}
|
||||
|
||||
@Get("/github")
|
||||
async githubContributors() {
|
||||
return this.utils.getCachedOrSet(
|
||||
`contributors:github`,
|
||||
async () => this.contributorsService.fetchGitHubContributors(),
|
||||
1000 * 60 * 60 * 24, // 24 hours
|
||||
);
|
||||
return this.contributorsService.fetchGitHubContributors();
|
||||
}
|
||||
|
||||
@Get("/crowdin")
|
||||
async crowdinContributors() {
|
||||
return this.utils.getCachedOrSet(
|
||||
`contributors:crowdin`,
|
||||
async () => this.contributorsService.fetchCrowdinContributors(),
|
||||
1000 * 60 * 60 * 24, // 24 hours
|
||||
);
|
||||
return this.contributorsService.fetchCrowdinContributors();
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ export class ContributorsService {
|
||||
avatar: data.avatarUrl,
|
||||
} satisfies ContributorDto;
|
||||
});
|
||||
} catch (error) {
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user