Skip to content

Commit

Permalink
Refactor name
Browse files Browse the repository at this point in the history
  • Loading branch information
selankon committed Oct 10, 2024
1 parent 78df412 commit dab5154
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const QuestionsFormProvider: React.FC<PropsWithChildren<QuestionsFormProv
return false
}

const votePackage = getVotePackage(election, electionChoices)
const votePackage = getVoteBallot(election, electionChoices)

return bvote(votePackage)
}
Expand All @@ -83,7 +83,7 @@ export const QuestionsFormProvider: React.FC<PropsWithChildren<QuestionsFormProv
)
}

export const getVotePackage = (election: PublishedElection, choices: FieldValues) => {
export const getVoteBallot = (election: PublishedElection, choices: FieldValues) => {
let results: number[] = []
switch (election.resultsType.name) {
case ElectionResultsTypeNames.SINGLE_CHOICE_MULTIQUESTION:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ import { useElection } from '@vocdoni/react-providers'
import { IQuestion, PublishedElection } from '@vocdoni/sdk'
import { FieldValues, SubmitErrorHandler } from 'react-hook-form'
import { QuestionField } from './Fields'
import {
DefaultElectionFormId,
QuestionsFormContextState,
QuestionsFormProvider,
QuestionsFormProviderProps,
useQuestionsForm,
} from './Form'
import { DefaultElectionFormId, QuestionsFormProvider, QuestionsFormProviderProps, useQuestionsForm } from './Form'
import { QuestionsTypeBadge } from './TypeBadge'
import { Voted } from './Voted'

Expand Down

0 comments on commit dab5154

Please sign in to comment.