Skip to content

Commit

Permalink
Merge pull request #130 from Giveth/add-rf6
Browse files Browse the repository at this point in the history
Add rf6
  • Loading branch information
MohammadPCh authored Oct 14, 2024
2 parents 43c7852 + 5a8fa31 commit d091aec
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/features/import-projects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const task = async () => {
await fetchRFProjectsByRound(4);
// await fetchRFProjectsByRound(5); //TODO: It will fill on 20th Sep
await fetchAndProcessRlProjects(5);
await fetchAndProcessRlProjects(6, false);
};

export const importProjects = async () => {
Expand Down
3 changes: 3 additions & 0 deletions src/features/import-projects/retroList/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export const RL_API_URLS: Record<RoundNumber, string> = {
5:
process.env.RL5_API_URL ||
"https://round5-api-eas.retrolist.app/5/projects",
6:
process.env.RL6_API_URL ||
"https://round6-api-eas.retrolist.app/6/projects",
};

export const rlSourceConfig: SourceConfig = {
Expand Down
8 changes: 6 additions & 2 deletions src/features/import-projects/retroList/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { rlSourceConfig } from "./constants";
import { generateRlUrl, manageProjectRemovals } from "./helper";
import { fetchRlProjects } from "./service";

export const fetchAndProcessRlProjects = async (round: number) => {
export const fetchAndProcessRlProjects = async (
round: number,
shouldHandlePrelimResult: boolean = true
) => {
try {
const data = await fetchRlProjects(round);
if (!data) return;
Expand All @@ -15,7 +18,8 @@ export const fetchAndProcessRlProjects = async (round: number) => {
rfRound: round,
};

await updateOrCreateProject(processedProject, rlSourceConfig);
if (shouldHandlePrelimResult)
await updateOrCreateProject(processedProject, rlSourceConfig);
}

// After processing all new projects, handle projects not in the new dataset for the current round
Expand Down
2 changes: 1 addition & 1 deletion src/features/import-projects/retroList/type.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type RoundNumber = 4 | 5;
export type RoundNumber = 4 | 5 | 6;

export type RlProjectInfo = {
id: string;
Expand Down

0 comments on commit d091aec

Please sign in to comment.