diff --git a/src/types/election/unpublished.ts b/src/types/election/unpublished.ts index 88a932c..fb87bee 100644 --- a/src/types/election/unpublished.ts +++ b/src/types/election/unpublished.ts @@ -42,7 +42,11 @@ export class UnpublishedElection extends Election { public addQuestion( title: string | MultiLanguage, description: string | MultiLanguage, - choices: Array<{ title: string; value: number } | { title: MultiLanguage; value: number }> + choices: Array< + | { title: string; value: number; meta?: CustomMeta } + | { title: MultiLanguage; value: number; meta?: CustomMeta } + >, + meta?: CustomMeta ): UnpublishedElection { this._questions.push({ title: typeof title === 'string' ? { default: title } : title, @@ -51,8 +55,10 @@ export class UnpublishedElection extends Election { return { title: typeof choice.title === 'string' ? { default: choice.title } : choice.title, value: choice.value, + ...(choice.meta && { meta: choice.meta }), } as IChoice; }), + ...(meta && { meta: meta }), }); return this;