refactor template rendering logic to one base template

This commit is contained in:
Johannes 2022-09-21 22:18:39 +02:00
parent 16e8cf9cd7
commit d60b715d96
18 changed files with 199 additions and 212 deletions

View file

@ -18,7 +18,7 @@ func (b *BaseHandler) DeleteOfficeHourHandler(w http.ResponseWriter, req *http.R
w.WriteHeader(http.StatusBadRequest)
}
_, err = b.requestRepo.Add(officeHour, models.RequestDelete)
Templates.ExecuteTemplate(w, "deleteSuccess.html", struct{}{})
b.serveTemplate(w, "deleteSuccess", nil)
} else {
officeHours, _ := b.officeHourRepo.GetAll(true)
timetable, slots := b.GetTimetable(officeHours)