Skip to content

Commit 5b195a4

Browse files
authoredMar 19, 2025··
Fix/checker past applications query (#54)
* fix: past application query and mocks * added changeset
1 parent e234385 commit 5b195a4

File tree

4 files changed

+118
-1
lines changed

4 files changed

+118
-1
lines changed
 

‎.changeset/nasty-masks-grab.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@gitcoin/ui": patch
3+
---
4+
5+
Fixes past applications query

‎packages/ui/src/features/checker/services/allo/dataLayer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export async function getPastApplicationsByApplicationIdFromIndexer(
5555
applicationId,
5656
});
5757

58-
return response.applications[0].project[0].applications as PastApplication[];
58+
return response.applications[0].project.applications as PastApplication[];
5959
} catch (e) {
6060
throw new Error(`Failed to fetch past applications data. with error: ${e}`);
6161
}

‎packages/ui/src/mocks/handlers.ts

+9
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { applicationsForManagers } from "./mockData/applicationsForManager";
55
import { checkerApplicationEvaluations } from "./mockData/checkerApplicationEvaluations";
66
import { checkerPoolData } from "./mockData/checkerPoolData";
77
import { getApplicationById } from "./mockData/indexerGetApplicationById";
8+
import { pastApplicationsByApplicationId } from "./mockData/pastApplicationsByApplicationId";
89

910
export const taskListHandler = http.get("https://jsonplaceholder.typicode.com/todos", () => {
1011
return HttpResponse.json([
@@ -43,10 +44,18 @@ export const checkerApplicationEvaluationsHandler = graphql.query(
4344
},
4445
);
4546

47+
export const getPastApplicationsByApplicationIdHandler = graphql.query(
48+
"getPastApplicationsByApplicationId",
49+
() => {
50+
return HttpResponse.json({ data: pastApplicationsByApplicationId });
51+
},
52+
);
53+
4654
export const handlers = [
4755
taskListHandler,
4856
applicationForManagerHandler,
4957
checkerPoolDataHandler,
5058
indexerGetApplicationByIdHandler,
5159
checkerApplicationEvaluationsHandler,
60+
getPastApplicationsByApplicationIdHandler,
5261
];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
export const pastApplicationsByApplicationId = {
2+
applications: [
3+
{
4+
project: {
5+
applications: [
6+
{
7+
id: "8",
8+
roundId: "18",
9+
statusSnapshots: [
10+
{
11+
status: "PENDING",
12+
updatedAt: "2024-05-08T21:50:53.000Z",
13+
updatedAtBlock: "119803138",
14+
},
15+
{
16+
status: "APPROVED",
17+
updatedAt: "2024-05-09T22:11:51.000Z",
18+
updatedAtBlock: "119846967",
19+
},
20+
],
21+
status: "APPROVED",
22+
round: {
23+
roundMetadata: {
24+
name: "HyperLocalizer Round One (Mocked)",
25+
support: {
26+
info: "https://t.me/hyperlocalizer_chat",
27+
type: "Telegram Group Invite Link",
28+
},
29+
roundType: "public",
30+
eligibility: {
31+
description: "Experimental round to fund public goods for local impact",
32+
requirements: [
33+
{
34+
requirement: "Public good that does local impact",
35+
},
36+
],
37+
},
38+
feesAddress: "",
39+
feesPercentage: 0,
40+
programContractAddress:
41+
"0x690ca3292c6b22f71dc881efdc80938eefff014d8cd92fd950819287f758d229",
42+
quadraticFundingConfig: {
43+
matchingCap: true,
44+
sybilDefense: false,
45+
matchingCapAmount: 20,
46+
minDonationThreshold: false,
47+
matchingFundsAvailable: 50,
48+
},
49+
},
50+
},
51+
},
52+
{
53+
id: "1",
54+
roundId: "7",
55+
statusSnapshots: [
56+
{
57+
status: "PENDING",
58+
updatedAt: "2024-03-28T09:44:37.000Z",
59+
updatedAtBlock: "118010150",
60+
},
61+
{
62+
status: "APPROVED",
63+
updatedAt: "2024-03-29T06:35:21.000Z",
64+
updatedAtBlock: "118047672",
65+
},
66+
],
67+
status: "APPROVED",
68+
round: {
69+
roundMetadata: {
70+
name: "Allo 2 🌐♻️ EcoSynthesisX Spring Round on Optimism (Mocked)",
71+
support: {
72+
info: "https://discord.gg/qkSy83uf",
73+
type: "Discord Group Invite Link",
74+
},
75+
roundType: "public",
76+
eligibility: {
77+
description:
78+
"Allo 2 protocol. EcoSynthesisX Spring round as a space for showcase public good projects, foster coordination and bring funding for bigger impact! Experimental approach on public good funding utilizing hyperstructure vision and Gitcoin infrastructure. Open for applications. Our Discord https://discord.gg/qkSy83uf",
79+
requirements: [
80+
{
81+
requirement: "",
82+
},
83+
],
84+
},
85+
feesAddress: "",
86+
feesPercentage: 0,
87+
programContractAddress:
88+
"0x6c2402cc20967444d61900db0a5e4823d78be1eb379ca4942bb90b3d045f6690",
89+
quadraticFundingConfig: {
90+
matchingCap: false,
91+
sybilDefense: false,
92+
minDonationThreshold: true,
93+
matchingFundsAvailable: 1000,
94+
minDonationThresholdAmount: 1,
95+
},
96+
},
97+
},
98+
},
99+
],
100+
},
101+
},
102+
],
103+
};

0 commit comments

Comments
 (0)