Skip to content

Commit

Permalink
ensure index is not overwritten (#3754)
Browse files Browse the repository at this point in the history
* fix apply

* fix index

* make it foolproof

* fix
  • Loading branch information
thelostone-mc authored Jan 27, 2025
1 parent c2a65ec commit dede34c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 6 additions & 4 deletions packages/builder/src/utils/roundApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ export const parseRoundApplicationMetadata = (
};
}

// const [major, minor, patch] = object.version.split(".").map(Number);
//
metadata.applicationSchema.questions =
metadata.applicationSchema.questions.map(
(q: any): RoundApplicationQuestion => ({
Expand All @@ -71,13 +69,17 @@ export const parseRoundApplicationMetadata = (
})
);

const maxId = Math.max(
...metadata.applicationSchema.questions.map((q) => q.id)
);

metadata.applicationSchema.questions = [
{
id: metadata.applicationSchema.questions.length,
id: maxId + 1,
type: "project",
},
{
id: metadata.applicationSchema.questions.length + 1,
id: maxId + 2,
type: "recipient",
},
...metadata.applicationSchema.questions,
Expand Down
1 change: 0 additions & 1 deletion packages/common/.env.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
REACT_APP_GRANTS_STACK_SEARCH_API_BASE_URL="https://gitcoin-search-dev.fly.dev"
REACT_APP_ALLO_API_URL="https://grants-stack-indexer-v2.gitcoin.co/graphql"
REACT_APP_PINATA_JWT=token-test
REACT_APP_PINATA_BASE_URL=http://localhost
REACT_APP_PASSPORT_API_KEY="test-key"
Expand Down

0 comments on commit dede34c

Please sign in to comment.