Skip to content

Commit

Permalink
Update resolver to look for script_options column and fall back to sc…
Browse files Browse the repository at this point in the history
…ript column.
  • Loading branch information
bchrobot committed Jun 25, 2019
1 parent ab8a9a7 commit 2374d20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/server/api/interaction-step.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ export const resolvers = {
...mapFieldsToModel(
[
"id",
"script",
"answerOption",
"answerActions",
"parentInteractionId",
"isDeleted"
],
InteractionStep
),
script: async interactionStep => {
const { script, script_options } = interactionStep;
return (script_options && script_options[0]) || script;
},
questionText: async interactionStep => {
return interactionStep.question;
},
Expand Down
1 change: 1 addition & 0 deletions src/server/models/interaction-step.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const InteractionStep = thinky.createModel(
// PROMPTS:
question: optionalString(),
script: optionalString(),
// script_options: [type.string()], // thinky does not support rethink-style list properties
created_at: timestamp(),

// Previously there were answer options, and no such thing as
Expand Down

0 comments on commit 2374d20

Please sign in to comment.