Skip to content

Commit

Permalink
NOREF/order fetch users (#2636)
Browse files Browse the repository at this point in the history
order fetch users
  • Loading branch information
samoddball authored Jun 13, 2024
1 parent 9863821 commit d871beb
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 d871beb

Please sign in to comment.