Skip to content

Commit

Permalink
♻️ return raw data
Browse files Browse the repository at this point in the history
  • Loading branch information
budougumi0617 committed Sep 19, 2020
1 parent 4a776c1 commit 79ec57b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (lc *LeetCode) GetQuestionByID(ctx context.Context, id int) (*Question, err
if !ok {
return nil, err
}
q, err := lc.GetQuestion(ctx, s.QuestionTitleSlug)
q, err := lc.GetQuestion(ctx, s.Stat.QuestionTitleSlug)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -148,14 +148,14 @@ func (lc *LeetCode) GetProblems(ctx context.Context) (*ProblemsResult, error) {
return &pr, nil
}

func (lc *LeetCode) GetStats(ctx context.Context) (map[int]*Stat, error) {
func (lc *LeetCode) GetStats(ctx context.Context) (map[int]*StatStatusPair, error) {
ps, err := lc.GetProblems(ctx)
if err != nil {
return nil, err
}
ss := make(map[int]*Stat, ps.NumTotal)
ss := make(map[int]*StatStatusPair, ps.NumTotal)
for _, sp := range ps.StatStatusPairs {
ss[sp.Stat.QuestionID] = &sp.Stat
ss[sp.Stat.QuestionID] = sp
}
return ss, nil
}
Expand Down

0 comments on commit 79ec57b

Please sign in to comment.