add method GetUsers, and array type Users -> []User

This commit is contained in:
2026-01-08 20:49:28 +02:00
parent 4f2c213bc6
commit 0388df48f5
3 changed files with 17 additions and 0 deletions

View File

@@ -41,6 +41,15 @@ func (s *GormUserStore) GetBy(by, value string) (*User, error) {
return &user, nil
}
func (s *GormUserStore) GetUsers() (*Users, error) {
var users Users
err := s.db.Omit("password").Find(&users).Error
if err != nil {
return nil, err
}
return &users, nil
}
func (s *GormUserStore) Update(user *User) error {
return s.db.Save(user).Error
}