This commit is contained in:
2024-07-04 21:19:34 +05:30
parent f67317a49a
commit b66d5a8f5f
3 changed files with 8 additions and 8 deletions

View File

@@ -11,7 +11,7 @@ pub fn (mut app App) post_signup(username string, email string, password string)
} }
return app.json(noti) return app.json(noti)
} }
noti := Noti{ noti := Noti{
status: "success", status: "success",
message: "User created successfully" message: "User created successfully"
@@ -20,7 +20,7 @@ pub fn (mut app App) post_signup(username string, email string, password string)
return app.json(noti) return app.json(noti)
} }
@['/controller/signup'] @['/controller/register']
pub fn (mut app App) controller_signup() vweb.Result{ pub fn (mut app App) controller_signup() vweb.Result{
username := app.query["username"] username := app.query["username"]
email := app.query["email"] email := app.query["email"]
@@ -32,7 +32,7 @@ pub fn (mut app App) controller_signup() vweb.Result{
} }
return app.json(noti) return app.json(noti)
} }
noti := Noti{ noti := Noti{
status: "success", status: "success",
message: "User created successfully" message: "User created successfully"
@@ -50,7 +50,7 @@ pub fn (mut app App) post_login(username string, password string) vweb.Result{
} }
return app.json(noti) return app.json(noti)
} }
return app.json(user) return app.json(user)
} }
@@ -65,6 +65,6 @@ pub fn (mut app App) controller_login() vweb.Result{
} }
return app.json(noti) return app.json(noti)
} }
return app.json(user) return app.json(user)
} }

View File

@@ -15,4 +15,4 @@ pub struct Noti {
mut: mut:
status string status string
message string message string
} }

View File

@@ -49,4 +49,4 @@ pub fn (mut app App) htmx_password(password string) vweb.Result{
return app.text(htmx_get_password(htmx)) return app.text(htmx_get_password(htmx))
} }
return app.text(htmx_get_password(htmx)) return app.text(htmx_get_password(htmx))
} }