lista_utenti: handle rappresentanti in :auth:

This commit is contained in:
2022-09-18 13:05:43 +02:00
parent 47a9d32670
commit 4b12c3d59d
2 changed files with 10 additions and 2 deletions
+9 -2
View File
@@ -9,7 +9,8 @@ import (
type authListaUtenti struct {
AuthService auth.Service
Macchinisti util.Set[string]
Macchinisti util.Set[string]
Rappresentanti util.Set[string]
}
func newAuthListaUtenti(authService auth.Service) (Service, error) {
@@ -18,7 +19,12 @@ func newAuthListaUtenti(authService auth.Service) (Service, error) {
return nil, err
}
return &authListaUtenti{authService, macchinisti}, nil
rappresentanti, err := loadRappresentanti()
if err != nil {
return nil, err
}
return &authListaUtenti{authService, macchinisti, rappresentanti}, nil
}
func (a *authListaUtenti) GetUtenti() ([]*model.ListUser, error) {
@@ -38,6 +44,7 @@ func (a *authListaUtenti) GetUtenti() ([]*model.ListUser, error) {
}
mergeMacchinisti(users, a.Macchinisti)
mergeRappresentanti(users, a.Macchinisti)
return users, nil
}
+1
View File
@@ -21,6 +21,7 @@ func newJsonListaUtenti(path string) (Service, error) {
if err != nil {
return nil, err
}
rappresentanti, err := loadRappresentanti()
if err != nil {
return nil, err