1
0
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:
Alexander Medvednikov 2022-08-16 22:19:58 +03:00
parent 9b9115471f
commit 8736f26a1c

View File

@ -49,9 +49,7 @@ pub fn (mut app App) new() vweb.Result {
}
['/new_article'; post]
pub fn (mut app App) new_article() vweb.Result {
title := app.form['title']
text := app.form['text']
pub fn (mut app App) new_article(title string, text string) vweb.Result {
if title == '' || text == '' {
return app.text('Empty text/title')
}