Using the following code on my server.js gives me the error :
TypeError: SqlContext Error. Failed on step "__result__" with: "(val.val || []).map is not a function"
Code:
app.get('/api/accounts/:cpts', function (req, res, next) {
var myCPT = req.params.cpts;
sql.execute({
query: sql.fromFile("./server/sql/AccountsByCPT"),
params: {
cptList: {
val: myCPT,
type: sql.VARCHAR,
asList: true
}
}
});
});