Commit bbd6d6a
committed
Week 2 Lessons 3.2: Get Album by ID
We achieved that 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 bbd6d6a
1 file changed
+9
-0
lines changed| 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