feat(ui): show user's lastAccess (#3342)

* feat(server): update user's lastAccess

* feat(ui): show user's lastAccess
This commit is contained in:
Deluan Quintão
2024-09-30 20:46:10 -04:00
committed by GitHub
parent 5e8085bf3c
commit a9334b7787
10 changed files with 148 additions and 11 deletions
+18
View File
@@ -3,8 +3,10 @@ package tests
import (
"encoding/base64"
"strings"
"time"
"github.com/navidrome/navidrome/model"
"github.com/navidrome/navidrome/utils/gg"
)
func CreateMockUserRepo() *MockedUserRepo {
@@ -54,5 +56,21 @@ func (u *MockedUserRepo) FindByUsernameWithPassword(username string) (*model.Use
}
func (u *MockedUserRepo) UpdateLastLoginAt(id string) error {
for _, usr := range u.Data {
if usr.ID == id {
usr.LastLoginAt = gg.P(time.Now())
return nil
}
}
return u.Error
}
func (u *MockedUserRepo) UpdateLastAccessAt(id string) error {
for _, usr := range u.Data {
if usr.ID == id {
usr.LastAccessAt = gg.P(time.Now())
return nil
}
}
return u.Error
}