Skip to content

Commit

Permalink
fix: remove uuid validation for proposal snapshot id (#1160)
Browse files Browse the repository at this point in the history
  • Loading branch information
1emu authored Aug 3, 2023
1 parent 228e0d4 commit 631a7cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/back/routes/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Request } from 'express'

import { SnapshotVote } from '../../clients/SnapshotGraphqlTypes'
import { SnapshotService } from '../../services/SnapshotService'
import { validateAddress, validateDates, validateFields, validateProposalId } from '../utils/validations'
import { validateAddress, validateDates, validateFields } from '../utils/validations'

export default routes((router) => {
router.get('/snapshot/status-space/:spaceName', handleAPI(getStatusAndSpace))
Expand Down Expand Up @@ -62,7 +62,6 @@ async function getPendingProposals(req: Request) {
async function getVpDistribution(req: Request<{ address: string; proposalSnapshotId?: string }>) {
const { address, proposalSnapshotId } = req.params
validateAddress(address)
validateProposalId(proposalSnapshotId, 'optional')

return await SnapshotService.getVpDistribution(address, proposalSnapshotId)
}
4 changes: 2 additions & 2 deletions src/services/SnapshotService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class SnapshotService {
return await SnapshotGraphql.get().getPendingProposals(start, end, fields, limit)
}

static async getVpDistribution(address: string, proposalId?: string): Promise<VpDistribution> {
return await SnapshotGraphql.get().getVpDistribution(address, proposalId)
static async getVpDistribution(address: string, proposalSnapshotId?: string): Promise<VpDistribution> {
return await SnapshotGraphql.get().getVpDistribution(address, proposalSnapshotId)
}
}

0 comments on commit 631a7cb

Please sign in to comment.