Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hacking #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/components/ProjectsTable/ProjectsTableHeadRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export function ProjectsTableHeadRow() {
</th> */}
<th scope="col" className="px-6 py-3 pr-24 bg-black md:left-0 md:sticky" onClick={() => handleSort("name")}>
<div className="flex items-center text-sm text-nowrap">

Project Name
<SortIcon field="name" sortConfig={sortConfig} />
</div>
Expand Down
1 change: 1 addition & 0 deletions src/components/ProjectsTable/ProjectsTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export function ProjectsTableRow({ project }: ProjectsTableRowProps) {
</td> */}

<td scope="row" className={"px-6 py-2 md:sticky md:left-0 bg-black font-bold text-lg"}>

<div className="flex items-center">

<img
Expand Down
10 changes: 7 additions & 3 deletions src/services/ezrfApi/applications.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EZRF_API_URL, ROUND_ID } from "./config";
import { EZRF_API_URL, ROUND } from "./config";
import {
MetricsApiResponse,
Project,
Expand All @@ -17,13 +17,15 @@ export const fetchApplications = async (): Promise<Project[]> => {
limit: 10,
skip: 0,
});


const res = await fetch(
`${EZRF_API_URL}projects.listApproved?input=${encodedInput}`,
{
headers: {
"content-type": "application/json",
"round-id": ROUND_ID,
"round-id": ROUND.id,
"x-api-key":ROUND.key
},
}
);
Expand All @@ -39,14 +41,16 @@ export const fetchApplications = async (): Promise<Project[]> => {
export const fetchMetrics = async (): Promise<ProjectWithMetrics[]> => {
const projects = await fetchApplications();
const projectIds = projects.map(({ id }) => id);
console.log(JSON.stringify(projectIds));
const encodedInput = encodeInput({ projectIds });

const res = await fetch(
`${EZRF_API_URL}metrics.projects?input=${encodedInput}`,
{
headers: {
"content-type": "application/json",
"round-id": ROUND_ID,
"round-id": ROUND.id,
"x-api-key":ROUND.key
},
}
);
Expand Down
21 changes: 20 additions & 1 deletion src/services/ezrfApi/config.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
export const EZRF_API_URL = "https://ezrf-impact.vercel.app/api/trpc/";
export const ROUND_ID = "the-sunnys"
// export const ROUND_ID = "the-sunnys"
// export const API_KEY = "08670c35100892eb840d37c36ed009999b3eb98befcbc42f5fc462b3b8b7b472"


type Round = {
id: string;
key: string;
};

const testRound: Round = {
id: "round-huss-3",
key: "b16ad95e191a16ecfb9a9ef6f9c3599fec7718ffd237d3fecef52a9390b1dd65",
};

// const sunnyRound: Round = {
// id: "the-sunnys",
// key: "bc2edd7987e6cba369add25aa7312875e06a8aa1c2dfe4b37fc05ab58db698e0",
// };

export const ROUND = testRound;