Commit ab78358
committed
Week 2 Lessons 3.2: Get Single Album by ID
We achieved that by using req.params.albumId and storing the value in a variable called albumIdToFind. Then using the .find method on the albumsData to find the album that has the matching id or albumIdToFind and then display that single album.
Tested by sending:
localhost:35981/albums/11 to get the album that has 11 as its id.1 parent fdc7b3b commit ab78358
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
67 | 76 | | |
68 | 77 | | |
69 | 78 | | |
0 commit comments