Skip to content

Commit

Permalink
feat(api): ♿️ Better item sample parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Mar 1, 2022
1 parent e17a1a0 commit dc51010
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/viewer/services/api/webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ const parseBlocksResultSample = (
const getSampleValue = (step: InputStep) => {
switch (step.type) {
case InputStepType.CHOICE:
return 'Item 1, Item 2, Item3'
return step.options.isMultipleChoice
? step.items.map((i) => i.content).join(', ')
: step.items[0].content ?? 'Item'
case InputStepType.DATE:
return new Date().toUTCString()
case InputStepType.EMAIL:
Expand Down

0 comments on commit dc51010

Please sign in to comment.