Nach Suchbegriff aus Datenbank lesen implementiert, außerdem structs mit new() instanziiert

This commit is contained in:
2023-10-07 16:58:34 +02:00
parent f570950425
commit 9acc6711fc
3 changed files with 34 additions and 20 deletions

View File

@ -23,7 +23,7 @@ func AddParticipant(i *int64) http.HandlerFunc {
func SubmitForm(ch chan<- *types.Briefing, i, j *int64) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var b types.Briefing
b := new(types.Briefing)
b.FirstName = r.PostFormValue("instructor-first")
b.LastName = r.PostFormValue("instructor-last")
@ -44,6 +44,6 @@ func SubmitForm(ch chan<- *types.Briefing, i, j *int64) http.HandlerFunc {
}
log.Println(b)
ch <- &b
ch <- b
}
}