Fix: Lint no-prototype-builtins (#5920)
* Fix: Lint no-prototype-builtins Closes: https://github.com/parse-community/parse-server/issues/5842 Reference: https://eslint.org/docs/rules/no-prototype-builtins * replace Object.hasOwnProperty.call
This commit is contained in:
committed by
Antonio Davi Macedo Coelho de Castro
parent
4bffdce047
commit
cf6e79ee75
@@ -122,13 +122,13 @@ export class AggregateRouter extends ClassesRouter {
|
||||
);
|
||||
}
|
||||
if (stageName === 'group') {
|
||||
if (stage[stageName].hasOwnProperty('_id')) {
|
||||
if (Object.prototype.hasOwnProperty.call(stage[stageName], '_id')) {
|
||||
throw new Parse.Error(
|
||||
Parse.Error.INVALID_QUERY,
|
||||
`Invalid parameter for query: group. Please use objectId instead of _id`
|
||||
);
|
||||
}
|
||||
if (!stage[stageName].hasOwnProperty('objectId')) {
|
||||
if (!Object.prototype.hasOwnProperty.call(stage[stageName], 'objectId')) {
|
||||
throw new Parse.Error(
|
||||
Parse.Error.INVALID_QUERY,
|
||||
`Invalid parameter for query: group. objectId is required`
|
||||
|
||||
Reference in New Issue
Block a user