Skip to content

David's work on the personal api#24

Open
CongoCash wants to merge 7 commits intoSF-WDI-LABS:masterfrom
CongoCash:master
Open

David's work on the personal api#24
CongoCash wants to merge 7 commits intoSF-WDI-LABS:masterfrom
CongoCash:master

Conversation

@CongoCash
Copy link

Please review my code.

Copy link

@jcheng305 jcheng305 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall API looks good, just needs to get EDIT function to save changes made along with the other two sections of the page to work. Just needs to add functionality to the TV and Project section of the page. Upon adding movie pictures, work on adjusting the picture automatically to the browser size. Also when editing the input values on the selected movie, find a way to keep the image so that way when changes are finalized the image isn't broken

Copy link

@mnfmnfm mnfmnfm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this project does get most of Create/Read/Update working, it's missing Delete, and the frontend functionality is quite broken--editing doesn't display updated data, although it's saved correctly, and images are not saved/displayed correctly for any of your data.

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You really need to .gitignore these files--they're taking over your code, and always claim that you're using a RUBY_MODULE.

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so many files that aren't necessary for your code to run

@@ -0,0 +1,14 @@
// // GET /api/albums
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commented out code doesn't need to be here

db.Movie.create(req.body)
// if (err) { console.log('error', err); }
console.log("hello");
res.json(req.body);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, you should use a callback, and actually send the saved movie, rather than sending back whatever was sent by the client.

db.Movie.create(req.body, function(err, savedMovie) {
  res.json(savedMovie);
})


function show(req, res) {
// send back all albums as JSON
db.Movie.findById({_id: req.params.movieid}, function(err, allMovies) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

findById just takes in the ID as the first argument, not an object.


.edit-movies {
width: 30%;
margin: 0 0 0 25px;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that you have these same styles on a bunch of classes makes me think you could have used one more class (like .movie-card or something) that was applied to .edit-movies and to .save-movies and to .delete-movies...

var personalData = [];

// var db = require('./models');
personalData.push({name: 'David Jue'});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, rather than use seeded DB data, this should have been a hardcoded object.

})
});

app.get('/api/profile', function apiProfile(req, res) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do all the work to put your profile information in the database, but still use this hardcoded object. You don't need all of that profile DB code.

</div>
<div class="row nav-styles">
<div class="col-sm-3"></div>
<div class="col-sm-2 text-center">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, having these 3 icons where 2 of them did nothing is a confusing structure for your site.

<div class="col-sm-3"></div>
</div>
<div class="row form-row">
<!--<div class="col-md-8 col-md-offset-2">-->
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented out code could be deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants