Skip to content

Commit 8130658

Browse files
committed
Fix purge
1 parent f23d80e commit 8130658

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/Adapters/Storage/Mongo/MongoStorageAdapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export class MongoStorageAdapter {
201201
// undefined as the reason.
202202
getClass(className) {
203203
return this._schemaCollection()
204-
.then(schemasCollection => schemasCollection._fechOneSchemaFrom_SCHEMA(className));
204+
.then(schemasCollection => schemasCollection._fechOneSchemaFrom_SCHEMA(className))
205205
}
206206

207207
// TODO: As yet not particularly well specified. Creates an object. Maybe shouldn't even need the schema,

src/Controllers/DatabaseController.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,8 @@ DatabaseController.prototype.collectionExists = function(className) {
100100

101101
DatabaseController.prototype.purgeCollection = function(className) {
102102
return this.loadSchema()
103-
.then((schema) => {
104-
schema.getOneSchema(className)
105-
})
106-
.then((schema) => {
107-
this.adapter.deleteObjectsByQuery(className, {}, schema);
108-
});
103+
.then(schemaController => schemaController.getOneSchema(className))
104+
.then(schema => this.adapter.deleteObjectsByQuery(className, schema, {}));
109105
};
110106

111107
DatabaseController.prototype.validateClassName = function(className) {

0 commit comments

Comments
 (0)