Permalink
Browse files

- remove object as param for getId

  • Loading branch information...
1 parent 953aecf commit bcfa099fc619e0c2fe6118d4a48d07ae480e407e @chadlung committed Mar 15, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 app.js
  2. +1 −1 models/entry.js
  3. +1 −1 tests/entry-tests.js
View
2 app.js
@@ -31,7 +31,7 @@ app.post('/*', function(req, res){
app.get('/*', function(req, res){
if(req.query.id != undefined) {
- entry.getId({ id: req.query.id }, function (error, returnedEntry) {
+ entry.getId(req.query.id, function (error, returnedEntry) {
if(error) {
res.send(error.message, httpStatus.INTERNAL_SERVER_ERROR);
} else {
View
@@ -22,7 +22,7 @@ entry.prototype.save = function(incomingJsonEntry, callback) {
}
entry.prototype.getId = function(id, callback) {
- jsonEntryModel.findOne({ _id: id.id }, callback);
+ jsonEntryModel.findOne({ _id: id }, callback);
}
entry.prototype.getFeed = function(obj, callback) {
View
@@ -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.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.equal(returnedIdEntry._id.toString(), returnedEntry._id.toString(), 'Failure: Returned entry ID did not match saved ID');
test.finish();

0 comments on commit bcfa099

Please sign in to comment.