examples/vweb: use map instead of string in call to app.json (#12338)

pull/12341/head
Miccah 2021-10-31 05:31:49 -05:00 committed by GitHub
parent 81b95ece51
commit ce9f26c589
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -26,7 +26,9 @@ fn main() {
['/users/:user'] ['/users/:user']
pub fn (mut app App) user_endpoint(user string) vweb.Result { pub fn (mut app App) user_endpoint(user string) vweb.Result {
id := rand.intn(100) id := rand.intn(100)
return app.json('{"$user": $id}') return app.json({
user: id
})
} }
pub fn (mut app App) index() vweb.Result { pub fn (mut app App) index() vweb.Result {