Skip to content

Commit 69da517

Browse files
committed
fix: find question by keyword error
1 parent 6f78bfa commit 69da517

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

common/utils/question-getter/getQuestionByKeyword.js

-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ import {getQuestionSearchJson} from "#resources/headers/questionSearchJson.js";
33

44
export async function getQuestionByKeyword(keyword) {
55
const questionData = await graphql(getQuestionSearchJson(keyword.toString()))
6-
console.log(questionData)
76
return questionData?.data?.problemsetQuestionList?.questions
87
}

common/view/finder.view.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ export async function easyFinderView() {
1111
const { mode } = await inquirer.prompt(modeQuestion, null)
1212
const questionKeyword = [{
1313
type: 'input',
14-
name: 'identity',
14+
name: 'keyword',
1515
message: '请输入关键词:',
1616
}]
1717

1818
switch (mode) {
1919
case '关键词搜索':
20-
const data = await getQuestionByKeyword(await inquirer.prompt(questionKeyword, null))
20+
const { keyword } = await inquirer.prompt(questionKeyword, null)
21+
const data = await getQuestionByKeyword(keyword)
2122
const questionList = [{
2223
type: 'list',
2324
name: 'chooseQuestion',

0 commit comments

Comments
 (0)