DB konstant als ersten Funktionsparameter gesetzt

This commit is contained in:
2023-10-28 09:03:19 +02:00
parent 387f662355
commit e3fb756bb1
2 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@ import (
"streifling.com/jason/sicherheitsunterweisung/packages/data"
)
func HandleInternalLogin(ss *[]*Session, cs chan<- *Session, db *data.DB) http.HandlerFunc {
func HandleInternalLogin(db *data.DB, ss *[]*Session, cs chan<- *Session) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
instructors, err := db.GetInstructors()
if err != nil {
@ -112,7 +112,7 @@ func HandleExternalLogin(ss *[]*Session) http.HandlerFunc {
}
}
func (s *Session) HandleParticipant(p *data.Participant, sq *[]data.Question, db *data.DB) http.HandlerFunc {
func (s *Session) HandleParticipant(db *data.DB, p *data.Participant, sq *[]data.Question) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
p.FirstName = r.PostFormValue("first-" + fmt.Sprint(p.Login))
p.LastName = r.PostFormValue("last-" + fmt.Sprint(p.Login))