Archived
Site.getAll created, basic Index generating
This commit is contained in:
1 parent
2ee5504efc
commit
78ae7f3a03
5 files changed
+28
-3
No files matched your search
@@ -30,4 +30,15 @@ Site.findById = function(id, callback){
|
||||
});
|
||||
};
|
||||
|
||||
// get a listing of all sites
|
||||
Site.getAll = function(callback){
|
||||
var sql = "SELECT * FROM sites";
|
||||
|
||||
con.query(sql, function(err, result){
|
||||
if (err) return callback(err);
|
||||
console.log("Site.getAll retrieved: " + result.length + "records.");
|
||||
callback(err, result);
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = Site;
|
||||
Reference in new issue
Block a user