Skip to content

Commit 05a0c5b

Browse files
authored
Merge pull request #3789 from JG-0204/patch-1
Update part9c.md
2 parents 9c10a9d + 5efc2fd commit 05a0c5b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/content/9/en/part9c.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,9 +838,15 @@ The first type parameter is the most interesting for us, it corresponds <i>the r
838838
We could and propably should give a proper type as the type variable. In our case it is an array of diary entries:
839839
840840
```js
841-
router.get('/', (_req, res: Response<DiaryEntry[]>) => { //
842-
res.send(res.send(diaryService.getNonSensitiveEntries());
841+
import { Response } from 'express'
842+
843+
// ...
844+
845+
router.get('/', (_req, res: Response<DiaryEntry[]>) => {
846+
res.send(diaryService.getNonSensitiveEntries());
843847
});
848+
849+
// ...
844850
```
845851
846852
If we now try to respond with wrong type of data, the code does not compile

0 commit comments

Comments
 (0)