removed unnecessary function

This commit is contained in:
GotPPay
2018-01-08 13:49:24 +01:00
parent 994670ce54
commit 61bd6862aa

View File

@@ -37,22 +37,6 @@ alexaApp.express({
preRequest: (request, response)=>{
console.log('Pre req');
/*
const alexaRequest = new alexa.request(request);
if (alexaRequest.type() === "IntentRequest") {
db.collection('skill_list').findOne({_id: ObjectID(skillDbID)}, (err,skill)=>{
if (skill) {
console.log(alexaRequest.data.request.intent);
let intentId = findElementByAttr(skill.intents, 'intentName', alexaRequest.data.request.intent.name);
const response = new alexa.response(alexaRequest.getSession());
if (intentId !== -1){
return response.say(skill.intents[intentId].answer);
}else{
return response.say('Sorry, I could not find desired intent');
}
}
});
}*/
}
});
@@ -61,56 +45,6 @@ alexaApp.express({
// from here on you can setup any other express routes or middlewares as nor
app.set("view engine", "ejs");
/*
alexaApp.launch(function(request, response) {
console.log("Alexa launch");
db.collection('skill_list').findOne({_id: ObjectID(skillDbID)}, (err,skill)=>{
if (skill){
console.log('pass');
return new Promise ((resolve,reject)=>{
}else{
console.log('error');
}
/*
if (err){
return response.say("I could not find desired skill")
console.log('error ' + err);
}else{
//return response.say(result.invocationAnswer);
return response.say('Welcome');
console.log('Poslano');
}
});
});*/
var findElementByAttr = function (data, attr, val){
for(var i = 0; i < data.length; i ++) {
if(data[i][attr] === val) {
return i;
}
}
return -1;
}
/*
alexaApp.request = (jsonRequest) => {
const alexaRequest = new alexa.request(jsonRequest);
if (alexaRequest.type() === "IntentRequest") {
db.collection('skill_list').findOne({_id: ObjectID(skillDbID)}, (err,skill)=>{
if (skill) {
console.log(alexaRequest.data.request.intent);
let intentId = findElementByAttr(skill.intents, 'intentName', alexaRequest.data.request.intent.name);
const response = new alexa.response(alexaRequest.getSession());
if (intentId !== -1){
response.say(skill.intents[intentId].answer);
}else{
response.say('Sorry, I could not find desired intent');
}
}
});
}
};
*/
var updateIntentsJSON = function(){
db.collection('skill_list').findOne({_id: ObjectID(skillDbID)}, (err, skill)=>{
@@ -125,24 +59,6 @@ var updateIntentsJSON = function(){
});
}
/*
alexaApp.intent("SimpleIntent", {
"slots": [],
"utterances": ["Tell me somethin"]
},
function(request, response) {
response.say("This is sample");
}
);
*/
/*
alexaApp.error = function(exception, request, response){
console.log('Error ' + exception);
response.say('Sorry, there was error in Saburly skill'); // TODO : Rephrase this
};*/
router.get ('/getSkill/:id', async (req, res, next) => {
try {
const id = req.params.id;