This commit is contained in:
2024-06-30 02:38:38 +05:30
parent 0ba46b6eca
commit e429ff701a

View File

@@ -2,7 +2,20 @@ module main
import vweb
@[post]
pub fn (mut app App) signup() vweb.Result{
return $vweb.html()
@['/signup'; post]
pub fn (mut app App) post_signup(username string, email string, password string) vweb.Result{
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)
}