Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Commit

Permalink
Merge pull request #572 from jdaudier/gh-pages
Browse files Browse the repository at this point in the history
Fix server add and update functions 👍
  • Loading branch information
addyosmani committed Mar 23, 2014
2 parents 6514fd4 + e371383 commit 0e33ce2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions chapters/05-exercise-2.md
Expand Up @@ -552,11 +552,11 @@ app.post( '/api/books', function( request, response ) {
});
book.save( function( err ) {
if( !err ) {
return console.log( 'created' );
} else {
return console.log( err );
}
return response.send( book );
console.log( 'created' );
return response.send( book );
} else {
console.log( err );
}
});
});
```
Expand Down Expand Up @@ -640,10 +640,10 @@ app.put( '/api/books/:id', function( request, response ) {
return book.save( function( err ) {
if( !err ) {
console.log( 'book updated' );
} else {
console.log( err );
}
return response.send( book );
return response.send( book );
} else {
console.log( err );
}
});
});
});
Expand Down

0 comments on commit 0e33ce2

Please sign in to comment.