Skip to content

Commit 88678d9

Browse files
Steve Greengermanattanasio
authored andcommitted
feat: Add support for generic (#200)
From generic will fully support: * text * image * options * pause car workspace now has: * Image response has now been added for amenity locations * Pause response has now been added for out of scope amentiy locations eg find a school * Value 0 is now handled for amenity location selection * Entity created to handle 0 value for amenity selection
1 parent d239235 commit 88678d9

File tree

12 files changed

+1472
-1441
lines changed

12 files changed

+1472
-1441
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ temp/
55
coverage
66
.env
77
npm-debug.log
8-
.jshintrc
8+
.jshintrc
9+
.DS_Store

app.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,6 @@ app.post('/api/message', function (req, res) {
5454
return res.status(err.code || 500).json(err);
5555
}
5656

57-
// This is a fix for now, as since Assistant version 2018-07-10,
58-
// output text can now be in output.generic.text
59-
var output = data.output;
60-
if (output.text.length === 0 && output.hasOwnProperty('generic')) {
61-
var generic = output.generic;
62-
63-
if (Array.isArray(generic)) {
64-
// Loop through generic and add all text to data.output.text.
65-
// If there are multiple responses, this will add all of them
66-
// to the response.
67-
for(var i = 0; i < generic.length; i++) {
68-
if (generic[i].hasOwnProperty('text')) {
69-
data.output.text.push(generic[i].text);
70-
} else if (generic[i].hasOwnProperty('title')) {
71-
data.output.text.push(generic[i].title);
72-
}
73-
}
74-
}
75-
}
76-
7757
return res.json(updateMessage(payload, data));
7858
});
7959
});

0 commit comments

Comments
 (0)