Skip to content
This repository has been archived by the owner on Dec 27, 2018. It is now read-only.

Commit

Permalink
DELETE doesn't need a body in SPHERE.
Browse files Browse the repository at this point in the history
  • Loading branch information
hajoeichler committed Nov 25, 2013
1 parent d33c7d6 commit cd66a56
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/oauth2.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ===========================================================
# sphere-node-connect - v0.1.0
# sphere-node-connect - v0.1.2
# ==============================================================
# Copyright (c) 2013 Nicola Molinari
# Licensed under the MIT license.
Expand Down
7 changes: 3 additions & 4 deletions lib/rest.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ===========================================================
# sphere-node-connect - v0.1.0
# sphere-node-connect - v0.1.2
# ==============================================================
# Copyright (c) 2013 Nicola Molinari
# Licensed under the MIT license.
Expand Down Expand Up @@ -69,12 +69,11 @@ exports.Rest.prototype.POST = function(resource, payload, callback) {
return exports.preRequest(this._options, params, callback);
};

exports.Rest.prototype.DELETE = function(resource, payload, callback) {
exports.Rest.prototype.DELETE = function(resource, callback) {
var params;
params = {
resource: resource,
method: "DELETE",
body: payload
method: "DELETE"
};
return exports.preRequest(this._options, params, callback);
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sphere-node-connect",
"description": "Quick and easy way to connect your Node.js app with SPHERE.IO.",
"version": "0.1.1",
"version": "0.1.2",
"keywords": [
"sphere",
"api",
Expand Down
3 changes: 1 addition & 2 deletions src/coffee/rest.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ exports.Rest.prototype.POST = (resource, payload, callback)->
body: payload
exports.preRequest(@_options, params, callback)

exports.Rest.prototype.DELETE = (resource, payload, callback)->
exports.Rest.prototype.DELETE = (resource, callback)->
params =
resource: resource
method: "DELETE"
body: payload
exports.preRequest(@_options, params, callback)

exports.Rest.prototype.PUT = -> #noop
Expand Down
4 changes: 2 additions & 2 deletions src/spec/integration.spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe "Integration test", ->

it "should get products", (done)->
rest = new Rest Config
rest.GET "/product-projections", (error, response, body)->
rest.GET "/products", (error, response, body)->
expect(response.statusCode).toBe 200
json = JSON.parse(body)
expect(json).toBeDefined()
Expand All @@ -37,6 +37,6 @@ describe "Integration test", ->
value: "bar"
rest.POST "/custom-objects", JSON.stringify(d), (error, response, body)->
expect(response.statusCode).toBe 201
rest.DELETE "/custom-objects/integration/foo", '', (error, response, body)->
rest.DELETE "/custom-objects/integration/foo", (error, response, body)->
expect(response.statusCode).toBe 200
done()

0 comments on commit cd66a56

Please sign in to comment.