Lots of changes, still more to do

This commit is contained in:
2025-03-27 15:03:43 +00:00
parent 27b862b84b
commit e13b375af7
8 changed files with 198 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
package services
import (
"database/sql"
"net/http"
"strconv"
"synlotto-website/services"
)
var db *sql.DB
func AdminMatchHandler(w http.ResponseWriter, r *http.Request) {
stats, err := services.RunTicketMatching(db, "manual")
if err != nil {
http.Error(w, "Matching failed: "+err.Error(), 500)
return
}
http.Redirect(w, r, "/admin?flash=Matched "+
strconv.Itoa(stats.TicketsMatched)+" tickets, "+
strconv.Itoa(stats.WinnersFound)+" winners.", http.StatusSeeOther)
}