Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var wallJSON = JSON.parse(results[0].JSON);
//there is no note, so we should try to access createdAt, if this doesn't exist too, set it to zero
if(wallJSON.notes.length == 0)
{
lastEdit = wallJSON.createdAt ? wallJSON.createdAt : 0;
callback("stop");
}
//Build the sql with all notes
else
{
var sql = "SELECT JSON FROM `primarywall`.`note` WHERE ";
for(var i=0;i
function(callback){
//build sql
var sql = "SELECT * FROM `note` WHERE ";
for(var i=0;i
exports.getDomainWalls = function (domain, callback)
{
var escapedDomain = client.escape(domain);
escapedDomain = escapedDomain.substring(1,escapedDomain.length-1);
client.query("SELECT wallID FROM `primarywall`.`wall` WHERE `wallID` LIKE '" + escapedDomain + "$%'", [], function (err, results, fields)
{
var success=err == null;
var walls = [];
//var walls = {};
if(success)
{
//map all walls in a object
for(var i in results)
{
//walls[results[i].wallID] = JSON.parse(results[i].JSON);
walls.push(results[i].wallID);
}