Conversation
mnfmnfm
left a comment
There was a problem hiding this comment.
If your app were displaying updates to the data in single-page style, rather than by refreshing, this would be an excellent app--you're doing well, but I wish you had found a solution other than refreshing.
| @@ -0,0 +1 @@ | |||
| This is my documentation! | |||
There was a problem hiding this comment.
haha, OK! But your documentation should be in your README.md file.
| base_url: 'https://evening-beach-72520.herokuapp.com/', | ||
| endpoints: [ | ||
| {method: "GET", path: "/api", description: "Describes all available endpoints"}, | ||
| {method: "GET", path: "/api/profile", description: "Describes all available endpoints"}, |
There was a problem hiding this comment.
Your profile doesn't describe available endpoints, it describes you!
| } | ||
|
|
||
| // GET /api/cliffs/:cliffId | ||
| function retrieve(req, res) { |
There was a problem hiding this comment.
unused function. you can get rid of this.
| // DELETE /api/cliffs/:cliffId | ||
| function destroy(req, res) { | ||
| console.log(req.params.id); | ||
| db.Cliff.findByIdAndRemove(req.params.id, (err, Cliff) => { |
There was a problem hiding this comment.
Usually, you'd use lower-case cliff for the parameter name.
| } | ||
| let response = { | ||
| message: "Cliff successfully deleted", | ||
| } |
| url: 'api/cliffs', | ||
| data: $(this).serialize(), | ||
| success: function() { | ||
| window.location = '/' |
There was a problem hiding this comment.
You could, instead, just render one cliff's worth of data, for the cliff you just saved.
| nearestCity: String, | ||
| gpsCoords: String, | ||
| height: String, | ||
| acessibility: String, |
There was a problem hiding this comment.
You're missing a c in accessibility--that's why it never saves correctly.
| @@ -1,15 +1,15 @@ | |||
| // This file allows us to seed our application with data | |||
There was a problem hiding this comment.
It would be great if your seed file actually did something!
|
|
||
| app.post('/api/cliffs/:id', controllers.cliffs.create); | ||
|
|
||
| app.get('/api/cliffs/:id', controllers.cliffs.retrieve); |
There was a problem hiding this comment.
You don't use this and could remove it.
|
|
||
| <!-- Text input--> | ||
| <div class="form-group"> | ||
| <label class="col-md-4 control-label" for="nearestCity">Nearest City</label> |
There was a problem hiding this comment.
The for attribute of the label needs to match the id of the input it's for, not the name. You should update the id of the input below this to be nearestCity.
Id like some feedback on some ideas to render page differently after I submit a form:
Id like some feedback on my back end CRUD functions and how I can use different more efficient code:
Id like some feedback on any DRY code you find: