Skip to content

Conversation

@breese8009
Copy link

Reviews site

});



Choose a reason for hiding this comment

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

Short and sweet, works.

.jumbotron {
opacity: 0.95;
}

Choose a reason for hiding this comment

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

Just doing what is needed.

message: "Welcome to BJJ reviews!",
description: "This is a app that allows people to read reviews on Brazilian Jiu Jitsu Academy",
documentation_url: "https://github.com/breese8009/express-personal-api",
base_url: "localhost:4000",

Choose a reason for hiding this comment

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

Had to use different port.

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.

Overall looks good--I wish you'd been able to get edit working.

@@ -0,0 +1,55 @@

Copy link

Choose a reason for hiding this comment

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

file name should just be bjjController.js, singular

console.log('body', req.body);


db.Bjj.create(req.body, function(err, reviews) {
Copy link

Choose a reason for hiding this comment

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

This gives back a singular, not a plural, so should probably have the variable name review rather than reviews

function show(req, res) {
// find one gym by id and send it back as JSON
console.log(req.params.bjjId);
db.Bjj.findById(req.params.bjjId, function(err, foundAlbum) {
Copy link

Choose a reason for hiding this comment

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

album 😭


var bjjHtml = (`
<div class="container forms" data-bjj='${bjj._id}'>
Copy link

Choose a reason for hiding this comment

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

this should be indented to reflect HTML structure.

@@ -1,15 +1,8 @@
// This file allows us to seed our application with data
// simply run: `node seed.js` from the root of this project folder.

Copy link

Choose a reason for hiding this comment

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

seed files are useful! please write them!

<!-- gym data display div -->

<div id="gymDisplay"></div>
<!-- <div class="container">
Copy link

Choose a reason for hiding this comment

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

this much commented out code is usually a bad sign--better to take it out of this file entirely.

$.ajax({
method:"DELETE",
url: '/api/bjj/'+currentBjjId,
success: currentBjjElem.remove()
Copy link

Choose a reason for hiding this comment

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

This removes that element immediately, not as a callback! It'll remove from the page whether or not the API call is successful. It should instead be:

success: function() {
  currentBjjElem.remove();
}

<div class="container forms" data-bjj='${bjj._id}'>
<div class="row">
<div class="col-sm-12">
<div class="card" style="width: 75%;">
Copy link

Choose a reason for hiding this comment

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

manually setting width is so sad! could add another class so you can still use class-based styling for these cards.


// loop through data and render to html
function renderMultipleReviews(reviews) {
console.log(reviews);
Copy link

Choose a reason for hiding this comment

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

indentation 😭

e.preventDefault();
var formData = $(this).serialize();
console.log('formData', formData);
$.post('/api/bjj', formData).done(renderMultipleReviews);
Copy link

Choose a reason for hiding this comment

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

odd that you're using $.ajax elsewhere, $.post here

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