Skip to content

Commit b728079

Browse files
authored
Merge pull request #2855 from PE5I/patch-3
Update part13a.md
2 parents 63edb64 + b852606 commit b728079

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/13/en/part13a.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ Now the result is exactly what we want:
781781
In the case of a collection of objects, the method toJSON does not work directly, the method must be called separately for each object in the collection:
782782

783783
```js
784-
router.get('/', async (req, res) => {
784+
app.get('/api/notes', async (req, res) => {
785785
const notes = await Note.findAll()
786786

787787
console.log(notes.map(n=>n.toJSON())) // highlight-line
@@ -806,7 +806,7 @@ The print looks like the following:
806806
However, perhaps a better solution is to turn the collection into JSON for printing by using the method [JSON.stringify](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify):
807807

808808
```js
809-
router.get('/', async (req, res) => {
809+
app.get('/api/notes', async (req, res) => {
810810
const notes = await Note.findAll()
811811

812812
console.log(JSON.stringify(notes)) // highlight-line

0 commit comments

Comments
 (0)