/api/malware-check/download: Remove unnecessary typing

This commit is contained in:
David Ernst
2026-01-05 23:43:10 -08:00
parent 1657ad375b
commit 95564a34c5

View File

@@ -1,5 +1,4 @@
import { NextApiRequest, NextApiResponse } from 'next'
import { CipherStrings } from 'src/crypto/stringify-shuffle'
import { firebase, pushover } from '../_services'
@@ -34,9 +33,7 @@ export default async (req: NextApiRequest, res: NextApiResponse) => {
// Fetch encrypted vote from database
const votes = await electionDoc.collection('votes').where('auth', '==', auth_token).get()
if (votes.empty) return res.status(404).json({ error: 'Vote not found' })
const storedVote = votes.docs[0].data()
const storedEncryptedVote = storedVote.encrypted_vote as Record<string, CipherStrings>
// Update the specific check entry
const updatedChecks = data.checks.map((entry: { already_seen_device?: null | string; otp?: string }) => {
@@ -56,7 +53,7 @@ export default async (req: NextApiRequest, res: NextApiResponse) => {
return res.status(200).json({
encrypted_randomizers: checkEntry.encrypted_randomizers,
encrypted_vote: storedEncryptedVote,
encrypted_vote: storedVote.encrypted_vote,
})
}