From ce9f26c5895f0ff24d3e2270ff395c96cda152eb Mon Sep 17 00:00:00 2001 From: Miccah Date: Sun, 31 Oct 2021 05:31:49 -0500 Subject: [PATCH] examples/vweb: use map instead of string in call to app.json (#12338) --- examples/vweb/vweb_example.v | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/vweb/vweb_example.v b/examples/vweb/vweb_example.v index f26726cff0..44409877a8 100644 --- a/examples/vweb/vweb_example.v +++ b/examples/vweb/vweb_example.v @@ -26,7 +26,9 @@ fn main() { ['/users/:user'] pub fn (mut app App) user_endpoint(user string) vweb.Result { id := rand.intn(100) - return app.json('{"$user": $id}') + return app.json({ + user: id + }) } pub fn (mut app App) index() vweb.Result {