mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tutorials: remove unnecessary json.encode (#15464)
This commit is contained in:
parent
f10ff0353e
commit
6ed69289a8
@ -384,12 +384,11 @@ in V is very simple:
|
|||||||
```v oksyntax
|
```v oksyntax
|
||||||
// article.v
|
// article.v
|
||||||
import vweb
|
import vweb
|
||||||
import json
|
|
||||||
|
|
||||||
['/articles'; get]
|
['/articles'; get]
|
||||||
pub fn (mut app App) articles() vweb.Result {
|
pub fn (mut app App) articles() vweb.Result {
|
||||||
articles := app.find_all_articles()
|
articles := app.find_all_articles()
|
||||||
return app.json(json.encode(articles))
|
return app.json(articles)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user