Skip to content

Commit cb6fbfd

Browse files
committed
fix: change plan list question title to cn
1 parent e94aaa1 commit cb6fbfd

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

common/view/finder.view.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,19 @@ async function studyMode(baseDir = process.cwd()) {
3030
if (createMode === 'single') {
3131
const { planSubGroups } = await getPlanQuestionList(planSlug)
3232
const planList = planSubGroups.reduce((acc, cur) => {
33-
acc.push(...cur.questions.map((res) => res.titleSlug))
33+
acc.push(...cur.questions.map((res) => {
34+
return {
35+
cnTitle: res.translatedTitle,
36+
enTitle: res.titleSlug
37+
}
38+
}))
3439
return acc
3540
}, [])
3641
const singleMode = {
3742
message: '请选择题目?',
3843
choices: planList.map((res) => ({
39-
name: res,
40-
value: res
44+
name: res.cnTitle,
45+
value: res.enTitle
4146
}))
4247
}
4348
const singleChoice = await select(singleMode)

resources/headers/planQuestionListJson.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
export function getPlanQuestionListJson(slug) {
66
return {
77
headers: { 'content-type': 'application/json' },
8-
body: `{"query":"\\n query studyPlanPastSolved($slug: String!) {\\n studyPlanV2Detail(planSlug: $slug) {\\n planSubGroups {\\n slug\\n questions {\\n titleSlug\\n status\\n }\\n }\\n }\\n}\\n ","variables":{"slug":"${slug}"},"operationName":"studyPlanPastSolved"}`,
8+
body: `{"query":"\\n query studyPlanPastSolved($slug: String!) {\\n studyPlanV2Detail(planSlug: $slug) {\\n planSubGroups {\\n slug\\n questions {\\n titleSlug\\n translatedTitle\\n status\\n }\\n }\\n }\\n}\\n ","variables":{"slug":"${slug}"},"operationName":"studyPlanPastSolved"}`,
99
method: 'POST'
1010
}
1111
}

0 commit comments

Comments
 (0)