Skip to content

Commit

Permalink
Merge pull request #233 from gnosisguild/fix-new-space-config-from-hub
Browse files Browse the repository at this point in the history
Fix snapshot space configuration validation
  • Loading branch information
jfschwarz authored Jan 15, 2024
2 parents 97e2bcf + 8bc9626 commit 915f46b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/app/src/services/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ export const getSnapshotSpaceSettings = async (ensName: string, chainId: number)
const res = await fetch(`${getHubUrl(chainId)}/api/spaces/${ensName}`)
if (res.ok) {
try {
return await res.json()
return await res.json().then((res) => {
// Remove flagged, verified, hibernated, and turbo properties from res, as they are not part of the space config, but rater extra info from the server.
const { flagged, verified, hibernated, turbo, ...filteredRes } = res
return filteredRes
})
} catch (error) {
return undefined // there is not snapshot space for this ENS
}
Expand Down
6 changes: 5 additions & 1 deletion packages/backend/lib/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ export const getSnapshotSpaceSettings = async (ensName: string, chainId: number)
const res = await fetch(`${getHubUrl(chainId)}/api/spaces/${ensName}`)
if (res.ok) {
try {
return await res.json()
return await res.json().then((res) => {
// Remove flagged, verified, hibernated, and turbo properties from res, as they are not part of the space config, but rater extra info from the server.
const { flagged, verified, hibernated, turbo, ...filteredRes } = res
return filteredRes
})
} catch (error) {
return undefined // there is not snapshot space for this ENS
}
Expand Down

0 comments on commit 915f46b

Please sign in to comment.