refac: stale test entries, failing web tests, Postgre backup bug, Hardcoded MySQL table count, Stale Postgre connection in test, own-scope visibility filter, GetAll ignoring its error, JSON tags in use-case types, 31 copies of DESKTOP_QUERY, ProfileView endpoint paths
This commit is contained in:
1 parent
efecdee200
commit
5d6f378fce
87 files changed
+696
-373
No files matched your search
@@ -21,8 +21,8 @@ type ListUsersAndInvitesUseCase struct {
|
||||
}
|
||||
|
||||
type RoleAssigner struct {
|
||||
ID uint32 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
ID uint32
|
||||
Name string
|
||||
}
|
||||
|
||||
func newRoleAssigner(account user.User) *RoleAssigner {
|
||||
@@ -89,7 +89,10 @@ func (g *ListUsersAndInvitesUseCase) ListUsersAndInvites() ([]DirectoryEntry, er
|
||||
now := time.Now()
|
||||
entries := []DirectoryEntry{}
|
||||
|
||||
users := g.userRepository.GetAll()
|
||||
users, err := g.userRepository.GetAll()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
loaded := make(map[uint32]user.User, len(users))
|
||||
for _, existingUser := range users {
|
||||
loaded[existingUser.ID] = existingUser
|
||||
@@ -98,7 +101,11 @@ func (g *ListUsersAndInvitesUseCase) ListUsersAndInvites() ([]DirectoryEntry, er
|
||||
entries = append(entries, userEntry(existingUser, lookupRoleRef(refs, existingUser.RoleID), assignerAmong(loaded, existingUser.RoleAssignedByID)))
|
||||
}
|
||||
|
||||
for _, existingInvite := range g.inviteRepository.GetAll() {
|
||||
invites, err := g.inviteRepository.GetAll()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, existingInvite := range invites {
|
||||
status := existingInvite.StatusAt(now)
|
||||
if status == invite.StatusAccepted {
|
||||
continue
|
||||
|
||||
Reference in new issue
Block a user