Skip to content

Commit

Permalink
Remove unused parameter in Cloud Function (#6969)
Browse files Browse the repository at this point in the history
  • Loading branch information
dplewis authored Oct 26, 2020
1 parent e6ac3b6 commit 74ba811
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
10 changes: 4 additions & 6 deletions spec/CloudCode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,7 @@ describe('Cloud Code', () => {
object.set('before', 'save');
});

Parse.Cloud.define('removeme', (req, res) => {
Parse.Cloud.define('removeme', () => {
const testObject = new TestObject();
return testObject
.save()
Expand All @@ -1324,11 +1324,10 @@ describe('Cloud Code', () => {
.then(object => {
object.unset('remove');
return object.save();
})
.catch(res.error);
});
});

Parse.Cloud.define('removeme2', (req, res) => {
Parse.Cloud.define('removeme2', () => {
const testObject = new TestObject();
return testObject
.save()
Expand All @@ -1339,8 +1338,7 @@ describe('Cloud Code', () => {
.then(object => {
object.unset('remove');
return object.save();
})
.catch(res.error);
});
});

Parse.Cloud.run('removeme')
Expand Down
7 changes: 3 additions & 4 deletions src/Routers/FunctionsRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class FunctionsRouter extends PromiseRouter {
});
}

static createResponseObject(resolve, reject, message) {
static createResponseObject(resolve, reject) {
return {
success: function (result) {
resolve({
Expand All @@ -109,7 +109,6 @@ export class FunctionsRouter extends PromiseRouter {
const error = triggers.resolveError(message);
reject(error);
},
message: message,
};
}
static handleCloudFunction(req) {
Expand Down Expand Up @@ -137,7 +136,7 @@ export class FunctionsRouter extends PromiseRouter {
return new Promise(function (resolve, reject) {
const userString = req.auth && req.auth.user ? req.auth.user.id : undefined;
const cleanInput = logger.truncateLogMessage(JSON.stringify(params));
const { success, error, message } = FunctionsRouter.createResponseObject(
const { success, error } = FunctionsRouter.createResponseObject(
result => {
try {
const cleanResult = logger.truncateLogMessage(JSON.stringify(result.response.result));
Expand Down Expand Up @@ -177,7 +176,7 @@ export class FunctionsRouter extends PromiseRouter {
return triggers.maybeRunValidator(request, functionName);
})
.then(() => {
return theFunction(request, { message });
return theFunction(request);
})
.then(success, error);
});
Expand Down

0 comments on commit 74ba811

Please sign in to comment.