working on printable PDF Forms
All checks were successful
Tests / Run Go Tests (push) Successful in 30s

This commit is contained in:
2025-09-08 00:32:29 +02:00
parent 12ed9959cb
commit 2eab598348
12 changed files with 305 additions and 22 deletions

View File

@@ -44,7 +44,7 @@ func parseTimestamp(r *http.Request, getKey string, fallback string) (time.Time,
// Returns bookings from DB with similar card uid -> checks for card uid in http query params
func getBookings(w http.ResponseWriter, r *http.Request) {
user, err := (*models.User).GetUserFromSession(nil, Session, r.Context())
user, err := models.GetUserFromSession(Session, r.Context())
if err != nil {
log.Println("No user found with the given personal number!")
http.Redirect(w, r, "/user/login", http.StatusSeeOther)
@@ -66,7 +66,7 @@ func getBookings(w http.ResponseWriter, r *http.Request) {
}
tsTo = tsTo.AddDate(0, 0, 1) // so that today is inside
workDays := (*models.WorkDay).GetWorkDays(nil, user.CardUID, tsFrom, tsTo)
workDays := models.GetWorkDays(user.CardUID, tsFrom, tsTo)
sort.Slice(workDays, func(i, j int) bool {
return workDays[i].Day.After(workDays[j].Day)
})
@@ -104,7 +104,7 @@ func updateBooking(w http.ResponseWriter, r *http.Request) {
log.Println("Error loading location", err)
loc = time.Local
}
user, err := (*models.User).GetUserFromSession(nil, Session, r.Context())
user, err := models.GetUserFromSession(Session, r.Context())
if err != nil {
log.Println("No user found!", err)
return