Skip to content

Commit

Permalink
order fetch users
Browse files Browse the repository at this point in the history
  • Loading branch information
samoddball committed Jun 13, 2024
1 parent 9863821 commit ca75e38
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pkg/dataloaders/fetch_user_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,18 @@ func (d *dataReader) fetchUserInfosByEUAUserIDs(ctx context.Context, euaUserIDs
return nil, []error{err}
}

return data, nil
store := map[string]*models.UserInfo{}

for _, info := range data {
store[info.Username] = info
}

var out []*models.UserInfo
for _, id := range euaUserIDs {
out = append(out, store[id])
}

return out, nil
}

func FetchUserInfoByEUAUserID(ctx context.Context, euaUserID string) (*models.UserInfo, error) {
Expand Down

0 comments on commit ca75e38

Please sign in to comment.