Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.intent(QUESTIONS_INTENT, (conv, params) => {
- let data = conv.data;
- let categoryId = data.categoryId;
- let formulas = data.formulas;
- let options = {
- 'method': 'PUT',
- 'url': apiUrl + 'questions/filter',
- 'body': {
- categoryId: categoryId,
- organisationId: organisation,
- formulas: formulas
- },
- 'json': true
- };
- return request(options).then(response => {
- // We need to change how we get these
- var questionText = params.questions;
- var questions = response.filter(item => item.text === questionText);
- data.questions = questions;
- conv.ask(questions[0].text);
- conv.contexts.set('colour');
- }, error => {
- conv.ask(JSON.stringify(error));
- });
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement