Skip to content

Commit b1fb639

Browse files
committed
fixes skygragon#31: [leetcode.cn] http error 400
1 parent 752e94e commit b1fb639

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: plugins/leetcode.cn.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ plugin.getProblems = function(cb) {
7777
const title = titles[problem.fid];
7878
if (title)
7979
problem.name = title;
80+
problem.fid = Number(fid) || fid
8081
});
8182

8283
return cb(null, problems);
@@ -97,12 +98,11 @@ plugin.getProblemsTitle = function(cb) {
9798
'query getQuestionTranslation($lang: String) {',
9899
' translations: allAppliedQuestionTranslations(lang: $lang) {',
99100
' title',
100-
' question {',
101-
' questionId',
102-
' }',
101+
' questionId',
102+
' __typename',
103103
' }',
104104
'}',
105-
''
105+
'',
106106
].join('\n'),
107107
variables: {},
108108
operationName: 'getQuestionTranslation'
@@ -116,7 +116,7 @@ plugin.getProblemsTitle = function(cb) {
116116

117117
const titles = [];
118118
body.data.translations.forEach(function(x) {
119-
titles[x.question.questionId] = x.title;
119+
titles[x.questionId] = x.title;
120120
});
121121

122122
return cb(null, titles);

0 commit comments

Comments
 (0)