Browse Source

Add code of delete user

for-closed-social
Unknown 10 years ago
parent
commit
d87ea87aee
2 changed files with 9 additions and 0 deletions
  1. +8
    -0
      routers/user/user.go
  2. +1
    -0
      web.go

+ 8
- 0
routers/user/user.go View File

@ -51,3 +51,11 @@ func SignUp(req *http.Request, r render.Render) {
"Title": fmt.Sprintf("%v", err),
})
}
func Delete(r render.Render) {
u := &models.User{}
err := models.DeleteUser(u)
r.HTML(403, "status/403", map[string]interface{}{
"Title": fmt.Sprintf("%v", err),
})
}

+ 1
- 0
web.go View File

@ -42,6 +42,7 @@ func runWeb(*cli.Context) {
m.Get("/", routers.Dashboard)
m.Get("/user/signin", user.SignIn)
m.Any("/user/signup", user.SignUp)
m.Any("/user/delete", user.Delete)
listenAddr := fmt.Sprintf("%s:%s",
utils.Cfg.MustValue("server", "HTTP_ADDR"),

Loading…
Cancel
Save