fixed autoLogout

This commit is contained in:
2025-04-24 17:48:03 +02:00
parent b7171d77c7
commit 9918c43527
2 changed files with 5 additions and 3 deletions

View File

@@ -68,7 +68,7 @@ func (u *User) GetAll() ([]User, error) {
// Returns true if there is a booking 1 for today -> meaning the user is at work
// Returns false if there is no booking today or the user is already booked out of the system
func (u *User) CheckAnwesenheit() bool {
qStr, err := DB.Prepare((`SELECT check_in_out FROM anwesenheit WHERE card_uid = $1 AND "timestamp" >= now()::date + interval '1h' ORDER BY "timestamp" DESC LIMIT 1;`))
qStr, err := DB.Prepare((`SELECT check_in_out FROM anwesenheit WHERE card_uid = $1 AND "timestamp"::date = now()::date ORDER BY "timestamp" DESC LIMIT 1;`))
if err != nil {
fmt.Printf("Error preparing query statement %v\n", err)
return false