27
This commit is contained in:
@@ -2,7 +2,20 @@ module main
|
|||||||
|
|
||||||
import vweb
|
import vweb
|
||||||
|
|
||||||
@[post]
|
@['/signup'; post]
|
||||||
pub fn (mut app App) signup() vweb.Result{
|
pub fn (mut app App) post_signup(username string, email string, password string) vweb.Result{
|
||||||
return $vweb.html()
|
app.service_add_user(username, email, password) or {
|
||||||
|
mut noti := Noti{
|
||||||
|
status: "failure",
|
||||||
|
message: err.str()
|
||||||
|
}
|
||||||
|
return app.json(noti)
|
||||||
|
}
|
||||||
|
|
||||||
|
noti := Noti{
|
||||||
|
status: "success",
|
||||||
|
message: "User created successfully"
|
||||||
|
}
|
||||||
|
|
||||||
|
return app.json(noti)
|
||||||
}
|
}
|
Reference in New Issue
Block a user