Split up db.go into multiple files
This commit is contained in:
@ -93,7 +93,7 @@ func AddUser(db *model.DB, s *control.CookieStore) http.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
num, err := db.CountEntries()
|
||||
num, err := db.CountEntries("users")
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
|
@ -29,7 +29,7 @@ func saveSession(w http.ResponseWriter, r *http.Request, s *control.CookieStore,
|
||||
|
||||
func HomePage(db *model.DB, s *control.CookieStore) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
numRows, err := db.CountEntries()
|
||||
numRows, err := db.CountEntries("users")
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user