Skip to content

Commit 449ca11

Browse files
committed
Break object deletions's dependency on schemaController
1 parent d4bd21f commit 449ca11

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/Adapters/Storage/Mongo/MongoStorageAdapter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ export class MongoStorageAdapter {
173173
// If no objects match, reject with OBJECT_NOT_FOUND. If objects are found and deleted, resolve with undefined.
174174
// If there is some other error, reject with INTERNAL_SERVER_ERROR.
175175

176-
// Currently accepts the schemaController, and validate for lecacy reasons
177-
deleteObjectsByQuery(className, query, schemaController, validate, parseFormatSchema) {
176+
// Currently accepts the validate for lecacy reasons. Currently accepts the schema, that may not actually be necessary.
177+
deleteObjectsByQuery(className, query, validate, schema) {
178178
return this.adaptiveCollection(className)
179179
.then(collection => {
180-
let mongoWhere = transform.transformWhere(className, query, { validate }, parseFormatSchema);
180+
let mongoWhere = transform.transformWhere(className, query, { validate }, schema);
181181
return collection.deleteMany(mongoWhere)
182182
})
183183
.then(({ result }) => {

src/Controllers/DatabaseController.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,7 @@ DatabaseController.prototype.destroy = function(className, query, { acl } = {})
337337
}
338338
throw error;
339339
})
340-
.then(parseFormatSchema => this.adapter.deleteObjectsByQuery(
341-
className,
342-
query,
343-
schemaController,
344-
!this.skipValidation,
345-
parseFormatSchema
346-
))
340+
.then(parseFormatSchema => this.adapter.deleteObjectsByQuery(className, query, !this.skipValidation, parseFormatSchema))
347341
.catch(error => {
348342
// When deleting sessions while changing passwords, don't throw an error if they don't have any sessions.
349343
if (className === "_Session" && error.code === Parse.Error.OBJECT_NOT_FOUND) {

0 commit comments

Comments
 (0)