Prevent afterFind with saving objects (#6127)
Fixes: https://github.com/parse-community/parse-server/issues/6088
This commit is contained in:
@@ -24,7 +24,8 @@ function RestQuery(
|
||||
className,
|
||||
restWhere = {},
|
||||
restOptions = {},
|
||||
clientSDK
|
||||
clientSDK,
|
||||
runAfterFind = true
|
||||
) {
|
||||
this.config = config;
|
||||
this.auth = auth;
|
||||
@@ -32,6 +33,7 @@ function RestQuery(
|
||||
this.restWhere = restWhere;
|
||||
this.restOptions = restOptions;
|
||||
this.clientSDK = clientSDK;
|
||||
this.runAfterFind = runAfterFind;
|
||||
this.response = null;
|
||||
this.findOptions = {};
|
||||
|
||||
@@ -774,6 +776,9 @@ RestQuery.prototype.runAfterFindTrigger = function() {
|
||||
if (!this.response) {
|
||||
return;
|
||||
}
|
||||
if (!this.runAfterFind) {
|
||||
return;
|
||||
}
|
||||
// Avoid doing any setup for triggers if there is no 'afterFind' trigger for this class.
|
||||
const hasAfterFindHook = triggers.triggerExists(
|
||||
this.className,
|
||||
|
||||
Reference in New Issue
Block a user