Skip to content

Commit

Permalink
fixes skygragon#31: [leetcode.cn] http error 400
Browse files Browse the repository at this point in the history
  • Loading branch information
kadaliao committed Dec 27, 2019
1 parent 752e94e commit b1fb639
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugins/leetcode.cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ plugin.getProblems = function(cb) {
const title = titles[problem.fid];
if (title)
problem.name = title;
problem.fid = Number(fid) || fid
});

return cb(null, problems);
Expand All @@ -97,12 +98,11 @@ plugin.getProblemsTitle = function(cb) {
'query getQuestionTranslation($lang: String) {',
' translations: allAppliedQuestionTranslations(lang: $lang) {',
' title',
' question {',
' questionId',
' }',
' questionId',
' __typename',
' }',
'}',
''
'',
].join('\n'),
variables: {},
operationName: 'getQuestionTranslation'
Expand All @@ -116,7 +116,7 @@ plugin.getProblemsTitle = function(cb) {

const titles = [];
body.data.translations.forEach(function(x) {
titles[x.question.questionId] = x.title;
titles[x.questionId] = x.title;
});

return cb(null, titles);
Expand Down

0 comments on commit b1fb639

Please sign in to comment.