Skip to content

Commit 3c61415

Browse files
committed
Fixes
1 parent c4abd1e commit 3c61415

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

src/Controllers/HooksController.js

+14-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var DatabaseAdapter = require('../DatabaseAdapter'),
2-
triggers = require('../triggers');
2+
triggers = require('../triggers'),
3+
request = require('request');
34
const collection = "_Hooks";
45

56
export class HooksController {
@@ -183,26 +184,26 @@ export class HooksController {
183184
}
184185

185186
function wrapToHTTPRequest(hook) {
186-
return function(request, response) {
187+
return function(req, res) {
187188
var jsonBody = {};
188-
for(var i in request) {
189-
jsonBody[i] = request[i];
189+
for(var i in req) {
190+
jsonBody[i] = req[i];
190191
}
191-
if (request.object) {
192-
jsonBody.object = request.object.toJSON();
193-
jsonBody.object.className = request.object.className;
192+
if (req.object) {
193+
jsonBody.object = req.object.toJSON();
194+
jsonBody.object.className = req.object.className;
194195
}
195-
if (request.original) {
196-
jsonBody.original = request.original.toJSON();
197-
jsonBody.original.className = request.original.className;
196+
if (req.original) {
197+
jsonBody.original = req.original.toJSON();
198+
jsonBody.original.className = req.original.className;
198199
}
199200
var jsonRequest = {};
200201
jsonRequest.headers = {
201202
'Content-Type': 'application/json'
202203
}
203204
jsonRequest.body = JSON.stringify(jsonBody);
204205

205-
require("request").post(hook.url, jsonRequest, function(err, res, body){
206+
request.post(hook.url, jsonRequest, function(err, httpResponse, body){
206207
var result;
207208
if (body) {
208209
if (typeof body == "string") {
@@ -218,9 +219,9 @@ function wrapToHTTPRequest(hook) {
218219
}
219220
}
220221
if (err) {
221-
return response.error(err);
222+
return res.error(err);
222223
} else {
223-
return response.success(result);
224+
return res.success(result);
224225
}
225226
});
226227
}

src/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ function ParseServer({
9191
}) {
9292

9393
// Initialize the node client SDK automatically
94-
Parse.initialize(appId, javascriptKey || '', masterKey);
95-
Parse.serverURL = serverURL || '';
94+
Parse.initialize(appId, javascriptKey, masterKey);
95+
Parse.serverURL = serverURL;
9696

9797
if (databaseAdapter) {
9898
DatabaseAdapter.setAdapter(databaseAdapter);

0 commit comments

Comments
 (0)