Skip to content

Commit

Permalink
fix(utils): 当题单中包含较多题目时,需分页获取所有题目
Browse files Browse the repository at this point in the history
  • Loading branch information
XYShaoKang committed Dec 24, 2022
1 parent 4fc1a83 commit ae5bfdc
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/content/utils/leetcode-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,21 @@ class LeetCodeApi {
},
}
return this.graphqlApi({ body }).then(
({ data }) => data.problemsetQuestionList.questions
async ({
data: {
problemsetQuestionList: { questions, hasMore },
},
}) => {
if (hasMore) {
const next = await this.getProblemsetQuestionList(
listId,
limit,
skip + limit
)
return questions.concat(next)
}
return questions
}
)
}
}
Expand Down

0 comments on commit ae5bfdc

Please sign in to comment.