mirror of https://github.com/EdgeVPNio/portal.git
FIxed the naming convention of the methods
parent
dd1ec59e50
commit
adcd51e59e
|
@ -44,7 +44,7 @@ exports.findAllIntervals = (req, res, dbInstance) => {
|
|||
exports.findOverlays = (req, res, dbInstance) => {
|
||||
|
||||
const intervalId = parseFloat(req.query.interval);
|
||||
dbInstance.checkOverlayUpdate(overlayModel, intervalId).then(data => {
|
||||
dbInstance.getOverlays(overlayModel, intervalId).then(data => {
|
||||
console.log("Response data being sent:", data);
|
||||
res.send(data);
|
||||
})
|
||||
|
|
|
@ -40,14 +40,10 @@ class DataBaseInterface {
|
|||
console.log("getTopology method not implemented by specific db");
|
||||
}
|
||||
|
||||
checkOverlayUpdate(tableName, intervalId) {
|
||||
getOverlays(tableName, intervalId) {
|
||||
console.log("checkOverlayUpdate method not implemented by specific db");
|
||||
}
|
||||
|
||||
checkTopologyUpdate() {
|
||||
console.log("checkTopologyUpdate method not implemented by specific db");
|
||||
}
|
||||
|
||||
close() {
|
||||
console.log("close method not implemented by specific db");
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ class MongoDBImpl extends DataBaseInterface {
|
|||
* @param {String} tableName Model to use to get the overlay.
|
||||
* @param {String} intervalId Interval identifier to query.
|
||||
*/
|
||||
async getOverlays(tableName, intervalId) {
|
||||
async findOverlays(tableName, intervalId) {
|
||||
if (intervalId) {
|
||||
//Find the next available interval, greater than the previous one from client
|
||||
return tableName.find({ "_id": { $gt: intervalId } }).sort({ '_id': 1 }).limit(1);
|
||||
|
@ -116,9 +116,9 @@ class MongoDBImpl extends DataBaseInterface {
|
|||
return tableName.find({ "Topology": { $elemMatch: { "OverlayId": overlayId } } }).sort({ "_id": -1 }).limit(1);
|
||||
}
|
||||
|
||||
async checkOverlayUpdate(tableName, intervalId) {
|
||||
async getOverlays(tableName, intervalId) {
|
||||
var overlayData = null;
|
||||
this.getOverlays(tableName, intervalId)
|
||||
this.findOverlays(tableName, intervalId)
|
||||
.then(data => {
|
||||
if (Object.keys(data).length === 0) {
|
||||
console.log("No data found, setting data to null.")
|
||||
|
|
Loading…
Reference in New Issue