Skip to content

Commit

Permalink
Cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinND committed Jun 13, 2014
1 parent 8bd32df commit 0874e97
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,20 +107,13 @@ var generateMapping = function(name, config) {
config.endpoint = config.endpoint.replace('{identifier}', identifier);
}

var options = {
uri: config.endpoint,
method: config.method,
qs: params,
body: body
};

// Build request (using supertest)
var r = request(this.apiHost)[options.method](options.uri)
.query(options.qs)
var r = request(this.apiHost)[config.method](config.endpoint)
.query(params)
.set('Authorization', this.authHeader);

if (config.body) {
r = r.send(options.body);
r = r.send(body);
}

r.expect(config.expectedStatus)
Expand Down

0 comments on commit 0874e97

Please sign in to comment.