Reputation: 21
I'm build an JS app that posts restaurant suggestions to users via a simple chat interface. I'm trying to reverse-engineer the movie assistant app, but I’m not sure how to write the part where the JS app posts data from DB to the UI. Unlike the movie assistant I would be using a simple text interface similar to the one the dialog-tool example features. I see two solutions:
Which of the two solutions is ideal? Thanks!
Upvotes: 0
Views: 108
Reputation: 2430
The recommended method is for you application to post the variables to Dialog. Indeed those variables might change on subsequent searches from the user. However this allows you to have in your dialog conditions based on the values.
See here an example to a code to post variables Dialog application starter kit - app.js
log('6. updating the dialog profile with the result from themoviedb.com');
var profile = {
client_id: req.body.client_id,
name_values: [
{ name:'Current_Index', value: searchResult.curent_index },
{ name:'Total_Pages', value: searchResult.total_pages },
{ name:'Num_Movies', value: searchResult.total_movies }
]
};
return updateProfile(profile)
Upvotes: 1