Bug fixes (#191)

This commit is contained in:
Luke Vella 2022-05-25 17:04:17 +01:00 committed by GitHub
parent 9fdbe46d19
commit 900fac5735
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View file

@ -9,9 +9,10 @@ export const normalizeVotes = (
optionIds: string[],
votes: ParticipantForm["votes"],
) => {
return optionIds.map(
(optionId, i) => votes[i] ?? { optionId, type: "no" as const },
);
return optionIds.map((optionId, i) => ({
optionId,
type: votes[i]?.type ?? ("no" as const),
}));
};
export const useAddParticipantMutation = () => {