From 631a7cba619597588dd7413bf3caafb628fd937e Mon Sep 17 00:00:00 2001 From: lemu Date: Thu, 3 Aug 2023 16:15:55 -0300 Subject: [PATCH] fix: remove uuid validation for proposal snapshot id (#1160) --- src/back/routes/snapshot.ts | 3 +-- src/services/SnapshotService.ts | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/back/routes/snapshot.ts b/src/back/routes/snapshot.ts index e7c82dd80..25b2d1297 100644 --- a/src/back/routes/snapshot.ts +++ b/src/back/routes/snapshot.ts @@ -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)) @@ -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) } diff --git a/src/services/SnapshotService.ts b/src/services/SnapshotService.ts index bbd639f6d..9a070c468 100644 --- a/src/services/SnapshotService.ts +++ b/src/services/SnapshotService.ts @@ -120,7 +120,7 @@ export class SnapshotService { return await SnapshotGraphql.get().getPendingProposals(start, end, fields, limit) } - static async getVpDistribution(address: string, proposalId?: string): Promise { - return await SnapshotGraphql.get().getVpDistribution(address, proposalId) + static async getVpDistribution(address: string, proposalSnapshotId?: string): Promise { + return await SnapshotGraphql.get().getVpDistribution(address, proposalSnapshotId) } }