Skip to content

Commit dede34c

Browse files
ensure index is not overwritten (#3754)
* fix apply * fix index * make it foolproof * fix
1 parent c2a65ec commit dede34c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/builder/src/utils/roundApplication.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ export const parseRoundApplicationMetadata = (
5656
};
5757
}
5858

59-
// const [major, minor, patch] = object.version.split(".").map(Number);
60-
//
6159
metadata.applicationSchema.questions =
6260
metadata.applicationSchema.questions.map(
6361
(q: any): RoundApplicationQuestion => ({
@@ -71,13 +69,17 @@ export const parseRoundApplicationMetadata = (
7169
})
7270
);
7371

72+
const maxId = Math.max(
73+
...metadata.applicationSchema.questions.map((q) => q.id)
74+
);
75+
7476
metadata.applicationSchema.questions = [
7577
{
76-
id: metadata.applicationSchema.questions.length,
78+
id: maxId + 1,
7779
type: "project",
7880
},
7981
{
80-
id: metadata.applicationSchema.questions.length + 1,
82+
id: maxId + 2,
8183
type: "recipient",
8284
},
8385
...metadata.applicationSchema.questions,

packages/common/.env.test

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
REACT_APP_GRANTS_STACK_SEARCH_API_BASE_URL="https://gitcoin-search-dev.fly.dev"
2-
REACT_APP_ALLO_API_URL="https://grants-stack-indexer-v2.gitcoin.co/graphql"
32
REACT_APP_PINATA_JWT=token-test
43
REACT_APP_PINATA_BASE_URL=http://localhost
54
REACT_APP_PASSPORT_API_KEY="test-key"

0 commit comments

Comments
 (0)