diff --git a/server/helpers/adapters/postgres.ts b/server/helpers/adapters/postgres.ts index 1ad09f9e..db8e15c7 100644 --- a/server/helpers/adapters/postgres.ts +++ b/server/helpers/adapters/postgres.ts @@ -175,10 +175,9 @@ export const getVoteBySender = async ( address: string, proposalId: string ) => { - console.log('getVoteBySender', [space, address, proposalId]); const query = `SELECT * FROM messages WHERE space = $1 AND address = $2 AND payload ->> 'proposalId' = $3 AND type = 'vote'`; const result = await db.query(query, [space, address, proposalId]); - console.log('getVoteBySender result', result.rows.length); + console.log('check if voted result:', result.rows.length); return result.rows; }; diff --git a/server/index.ts b/server/index.ts index 7fc44972..4974d3de 100644 --- a/server/index.ts +++ b/server/index.ts @@ -467,21 +467,15 @@ router.post('/message', async (req, res) => { if (isNotInVotingWindow) return sendError(res, 'not in voting window'); - console.log('checking if already voted CURRENT', [ + console.log('checking if already voted:', [ space, body.address, msg.payload.proposalId ]); - console.log('checking if already voted NEW', [ - space, - msg.payload.metadata.memberAddress, - msg.payload.proposalId - ]); - const votes = await getVoteBySender( space, - body.address, + msg.payload.metadata.memberAddress, msg.payload.proposalId ); if (votes && votes.length > 0) return sendError(res, 'already voted');