Code cleaning.
This commit is contained in:
@@ -40,7 +40,7 @@ class MongoClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
delete(collectionName, entityId, callback) {
|
delete(collectionName, entityId, callback) {
|
||||||
this.db.collection(collectionName).deleteOne({_id: mongodb.ObjectId(entityId)}, (error, result) => {
|
this.db.collection(collectionName).deleteOne({_id: mongodb.ObjectId(entityId)}, (error) => {
|
||||||
assert.equal(null, error, `Unable to delete ${collectionName} entity with id ${entityId}: ${error}.`);
|
assert.equal(null, error, `Unable to delete ${collectionName} entity with id ${entityId}: ${error}.`);
|
||||||
console.log(`Entity ${collectionName} with id ${entityId} deleted.`);
|
console.log(`Entity ${collectionName} with id ${entityId} deleted.`);
|
||||||
callback();
|
callback();
|
||||||
|
|||||||
@@ -21,6 +21,6 @@ class Repository {
|
|||||||
delete(entityId, callback) {
|
delete(entityId, callback) {
|
||||||
this.mongoClient.delete(this.collectionName, entityId, callback);
|
this.mongoClient.delete(this.collectionName, entityId, callback);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
module.exports = Repository;
|
module.exports = Repository;
|
||||||
Reference in New Issue
Block a user