Closed folkertjan closed 6 years ago
This looks great, and thanks for the cat! 😸
shelter
branch for the code as it was back at the shelter assignment, storage
for how it was when you handed it in, and master
as the most recent stuff (so same as storage
in this case). That makes sense to me at least! 🤷♂️id
in every table as the primary key, makes more sense than sh_id
shelterId
over shelterID
(as it corresponds with most stuff in JavaScript, like document.getElementById
)!next
still needed after showErrorPage
?fs.rename
could fail with an error, but it’s not logged anywhere, so you’d never know! Now I get (node:35800) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
notFound
still used? Should it send something back?view/form
, but you could also SELECT all animal shelters and pass that to the form and render the <option>
s dynamically!SELECT * FROM animal LEFT JOIN shelter ON animal.shelterId=shelter.sh_id WHERE animal.id = ?
weight
an int?date
s?This assignment took a lot less time than the Shelter assignment. Probably the part where I was most unsure of what I was doing was setting up the SQL database.
How much time did both parts take?
If I was supposed to give different error messages back, please let me know as I am not really certain I found ways to deliver all of them 😅
But other than those it looks rather good!
Furthermore I wasn't sure what's a better practice: changing the query to exclude unused data fields or decide within the template pages to leave certain data object properties away.
That really depends. I think for the list route it makes sense to just SELECT the properties that are needed, as with many animals it could be significantly faster. The detail page would result in a less significant improvement. But anyway, this only really starts to matter in production and with many people using the site!
P.S. also not sure if the package.json file is still correct as I have no clue what half of the scripts / test packages do.
Looks good! There’s some dev-dependencies, build.js
, and tests still left over from the prev db
. Then there’s some stuff to check code-style, (stylelint, xo, remark), but you’re free not to use them!
All in all, well done!
Storage Assignment
link to repo
Thoughts
This assignment took a lot less time than the Shelter assignment. Probably the part where I was most unsure of what I was doing was setting up the SQL database. After that, rewriting the express server to get data from the SQL database instead of the local db folder was not too difficult. (It's working at least) If I was supposed to give different error messages back, please let me know as I am not really certain I found ways to deliver all of them 😅 Furthermore I wasn't sure what's a better practice: changing the query to exclude unused data fields or decide within the template pages to leave certain data object properties away. P.S. also not sure if the package.json file is still correct as I have no clue what half of the scripts / test packages do.
Imma get some well earned rest now