diff --git a/client/src/components/Collab/CollabPolls.test.tsx b/client/src/components/Collab/CollabPolls.test.tsx index 5d8275ebf..8a526ae82 100644 --- a/client/src/components/Collab/CollabPolls.test.tsx +++ b/client/src/components/Collab/CollabPolls.test.tsx @@ -30,7 +30,7 @@ const buildPoll = (overrides: Record = {}) => ({ { id: 1, text: 'Paris', label: 'Paris', voters: [] }, { id: 2, text: 'Rome', label: 'Rome', voters: [] }, ], - multi_choice: false, + multiple_choice: false, is_closed: false, deadline: null, created_by: 1, diff --git a/client/src/components/Collab/CollabPolls.tsx b/client/src/components/Collab/CollabPolls.tsx index 951424657..530f2b1ca 100644 --- a/client/src/components/Collab/CollabPolls.tsx +++ b/client/src/components/Collab/CollabPolls.tsx @@ -26,7 +26,7 @@ interface Poll { id: number question: string options: PollOption[] - multi_choice: boolean + multiple_choice: boolean is_closed: boolean deadline: string | null created_by: number @@ -59,7 +59,7 @@ function totalVotes(poll) { // ── Create Poll Modal ──────────────────────────────────────────────────────── interface CreatePollModalProps { onClose: () => void - onCreate: (data: { question: string; options: string[]; multi_choice: boolean }) => Promise + onCreate: (data: { question: string; options: string[]; multiple_choice: boolean }) => Promise t: (key: string) => string } @@ -80,7 +80,9 @@ function CreatePollModal({ onClose, onCreate, t }: CreatePollModalProps) { if (!canSubmit) return setSubmitting(true) try { - await onCreate({ question: question.trim(), options: options.filter(o => o.trim()), multi_choice: multiChoice }) + // `multiple_choice` is the field the server reads (nest/collab/collab.service.ts); + // the old `multi_choice` name was silently dropped, losing desktop multi-choice. + await onCreate({ question: question.trim(), options: options.filter(o => o.trim()), multiple_choice: multiChoice }) onClose() } catch {} finally { setSubmitting(false) } } @@ -232,7 +234,7 @@ function PollCard({ poll, currentUser, canEdit, onVote, onClose, onDelete, t }: {remaining} )} - {poll.multi_choice && ( + {poll.multiple_choice && ( {t('collab.polls.multiChoice')} diff --git a/client/src/mobile/screens/trip/tabs/MCollabPolls.tsx b/client/src/mobile/screens/trip/tabs/MCollabPolls.tsx index 6c4c0b2a4..fd4dc280e 100644 --- a/client/src/mobile/screens/trip/tabs/MCollabPolls.tsx +++ b/client/src/mobile/screens/trip/tabs/MCollabPolls.tsx @@ -97,8 +97,8 @@ export default function MCollabPolls({ planner }: MCollabPollsProps) { const res = (await collabApi.createPoll(tripId, { question: data.question, options: data.options, - // Server reads `data.multiple || data.multiple_choice` (collabService.ts) — - // both are sent so either shape lands correctly. + // Server reads `data.multiple || data.multiple_choice` + // (nest/collab/collab.service.ts) — both are sent so either shape lands. multiple: data.multipleChoice, multiple_choice: data.multipleChoice, deadline: data.deadline || undefined,