1
0
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:
Alwin Arrasyid 2022-08-19 23:27:26 +07:00 committed by GitHub
parent f10ff0353e
commit 6ed69289a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -384,12 +384,11 @@ in V is very simple:
```v oksyntax
// article.v
import vweb
import json
['/articles'; get]
pub fn (mut app App) articles() vweb.Result {
articles := app.find_all_articles()
return app.json(json.encode(articles))
return app.json(articles)
}
```