You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey guys, nice looking code, I just have a few comments -
I think you really need to break up your issues more, starting with the user stories.
As a User I want to be able to add, delete, edit and see books in my database
I guess this is your #4. Tasks (and therefore issues) this could logically be broken into:
Show books:
Make a GET endpoint
this will use a select query to get all the book data and render all the books using a handlebars template
You have pretty much already done this on the GSG_library
Add a book:
Make a GET /add-book endpoint. This will render a form to add a book to the database. The from will POST data to another endpoint eg: /books
Make POST /books endpoint: Will take req.body from the post and add it to the books table using a query. Will probably just send back the id of the book you've added?
Delete a book:
The view which shows all the books could have a delete button on each of the books, which when you click on it will make a request to an endpoint that includes that book's id (this should be easy to do in handlebars. The endpoint could be books/:id and the request could be a DELETE request
DELETE /books/:id: Will delete the book with the id from the req.params
Edit a book:
Make a new end point GET /edit-books/:id. This will render a form to edit a book. The form will PUT data to another endpoint, eg /books/:id
PUT /books/:id: Will take req.body from the post and update it to book with id from the req.params
I know you kind of have done this already, and you maybe already have all this planned out, but it is sooooo much easier for you to keep track of if you document these in issues.
As a User I want to be able to lend books to members
This is basically #3. I can't remember how this should work, but I would keep this seperate from the above user journey/view/template. I'm not going to go into the same amount of detail as above - I'll leave that for you, but something like:
Make a new endpoint /lend or something (think you have this planned already).
Serve up a new template here which can facilitate this lending - I imagine a search bar to search books. Once you click on a book, this should then let you add a member to lend to (maybe again by a search bar). When you click lend, this makes a database request to update the book in the db as lent to member with id whatever.
As a User I want to see what books have been lended to whom
Kind of similar to #2 I guess - for me #2 is too complicated. All that needs to happen for this story is to render a template that show's books that have been lent, and who to, and a button to send an email.
Again I know you have probably planned this out already, but I very much recommend thinking of all the different tasks you need to do just to complete the above journeys and write them out in issues.
The text was updated successfully, but these errors were encountered:
Hey guys, nice looking code, I just have a few comments -
I think you really need to break up your issues more, starting with the user stories.
I guess this is your #4. Tasks (and therefore issues) this could logically be broken into:
GET
endpointGSG_library
GET /add-book
endpoint. This will render a form to add a book to the database. The from willPOST
data to another endpoint eg:/books
POST /books
endpoint: Will take req.body from the post and add it to the books table using a query. Will probably just send back the id of the book you've added?books/:id
and the request could be aDELETE
requestDELETE /books/:id
: Will delete the book with the id from the req.paramsGET /edit-books/:id
. This will render a form to edit a book. The form willPUT
data to another endpoint, eg/books/:id
PUT /books/:id
: Will take req.body from the post and update it to book with id from the req.paramsI know you kind of have done this already, and you maybe already have all this planned out, but it is sooooo much easier for you to keep track of if you document these in issues.
This is basically #3. I can't remember how this should work, but I would keep this seperate from the above user journey/view/template. I'm not going to go into the same amount of detail as above - I'll leave that for you, but something like:
/lend
or something (think you have this planned already).Kind of similar to #2 I guess - for me #2 is too complicated. All that needs to happen for this story is to render a template that show's books that have been lent, and who to, and a button to send an email.
Again I know you have probably planned this out already, but I very much recommend thinking of all the different tasks you need to do just to complete the above journeys and write them out in issues.
The text was updated successfully, but these errors were encountered: