mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tutorials: simplify new_article() a bit
This commit is contained in:
parent
9b9115471f
commit
8736f26a1c
@ -49,9 +49,7 @@ pub fn (mut app App) new() vweb.Result {
|
|||||||
}
|
}
|
||||||
|
|
||||||
['/new_article'; post]
|
['/new_article'; post]
|
||||||
pub fn (mut app App) new_article() vweb.Result {
|
pub fn (mut app App) new_article(title string, text string) vweb.Result {
|
||||||
title := app.form['title']
|
|
||||||
text := app.form['text']
|
|
||||||
if title == '' || text == '' {
|
if title == '' || text == '' {
|
||||||
return app.text('Empty text/title')
|
return app.text('Empty text/title')
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user