function serveDronesInformation(req, res){
    var username = req.session.user;

    var query = "SELECT * FROM DRONES WHERE \"owner\" = ?";
    dashDB.query(query, [username], function(err, response){
        if(err){
            logger.error("[drones.information] " + err.message);
            res.status(500).send("Server connection error");
        } else if(response.length == 0){
            res.status(404).send("User not found");
        } else {
            // Should add drone status
            for(var i = 0; i < response.length; i++){
                response[i].status = DroneCoordinator.getStatus(response[i].name);
            }
            res.status(200).send(response);
        }
    });


}
/**
 * Serve drone information for a user from SQL database
 * @param req {Object} The request from the client
 * @param res {Object} The response for the client
 */
Serve drone information for a user from SQL database
@param req {Object} The request from the client
@param res {Object} The response for the client
Serve drone information for a user from SQL database @param req { Object } The request from the client @param res { Object } The response for the client
function serveDronesInformation(req, res){
    var username = req.session.user;
    var query = "SELECT * FROM DRONES WHERE \"owner\" = ?";
    dashDB.query(query, [username], function(err, response){
        if(err){
            logger.error("[drones.information] " + err.message);
            res.status(500).send("Server connection error");
        } else if(response.length == 0){
            res.status(404).send("User not found");
        } else {
            for(var i = 0; i < response.length; i++){
                response[i].status = DroneCoordinator.getStatus(response[i].name);
            }
            res.status(200).send(response);
        }
    });
}
function serveDronesInformation ( req , res ) { var username = req . session . user ; var query = "SELECT * FROM DRONES WHERE \"owner\" = ?" ; dashDB . query ( query , [ username ] , function ( err , response ) { if ( err ) { logger . error ( "[drones.information] " + err . message ) ; res . status ( 500 ) . send ( "Server connection error" ) ; } else if ( response . length == 0 ) { res . status ( 404 ) . send ( "User not found" ) ; } else { for ( var i = 0 ; i < response . length ; i ++ ) { response [ i ] . status = DroneCoordinator . getStatus ( response [ i ] . name ) ; } res . status ( 200 ) . send ( response ) ; } } ) ; }
Serve drone information for a user from SQL database
 @param req {Object} The request from the client
 @param res {Object} The response for the client
Serve drone information for a user from SQL database @param req { Object } The request from the client @param res { Object } The response for the client
// Should add drone status