Skip to content

Commit

Permalink
- remove object as param for getId
Browse files Browse the repository at this point in the history
  • Loading branch information
chadlung committed Mar 15, 2012
1 parent 953aecf commit bcfa099
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app.js
Expand Up @@ -31,7 +31,7 @@ app.post('/*', function(req, res){


app.get('/*', function(req, res){ app.get('/*', function(req, res){
if(req.query.id != undefined) { if(req.query.id != undefined) {
entry.getId({ id: req.query.id }, function (error, returnedEntry) { entry.getId(req.query.id, function (error, returnedEntry) {
if(error) { if(error) {
res.send(error.message, httpStatus.INTERNAL_SERVER_ERROR); res.send(error.message, httpStatus.INTERNAL_SERVER_ERROR);
} else { } else {
Expand Down
2 changes: 1 addition & 1 deletion models/entry.js
Expand Up @@ -22,7 +22,7 @@ entry.prototype.save = function(incomingJsonEntry, callback) {
} }


entry.prototype.getId = function(id, callback) { entry.prototype.getId = function(id, callback) {
jsonEntryModel.findOne({ _id: id.id }, callback); jsonEntryModel.findOne({ _id: id }, callback);
} }


entry.prototype.getFeed = function(obj, callback) { entry.prototype.getFeed = function(obj, callback) {
Expand Down
2 changes: 1 addition & 1 deletion tests/entry-tests.js
Expand Up @@ -24,7 +24,7 @@ exports['test_save_and_get_id'] = function(test, assert) {
assert.equal(returnedEntry.feed, TEST_FEED, 'Failure: Feed should match original data'); assert.equal(returnedEntry.feed, TEST_FEED, 'Failure: Feed should match original data');
assert.equal(returnedEntry.selfHref, TEST_SELF_HREF + '?id=' + returnedEntry._id, 'Failure: Self Href should match original data'); assert.equal(returnedEntry.selfHref, TEST_SELF_HREF + '?id=' + returnedEntry._id, 'Failure: Self Href should match original data');


entry.getId({ id: returnedEntry._id }, function (error, returnedIdEntry) { entry.getId(returnedEntry._id, function (error, returnedIdEntry) {
assert.ok(!error); assert.ok(!error);
assert.equal(returnedIdEntry._id.toString(), returnedEntry._id.toString(), 'Failure: Returned entry ID did not match saved ID'); assert.equal(returnedIdEntry._id.toString(), returnedEntry._id.toString(), 'Failure: Returned entry ID did not match saved ID');
test.finish(); test.finish();
Expand Down

0 comments on commit bcfa099

Please sign in to comment.