File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const create = data => {
4
4
const path = require ( 'path' ) ;
5
5
const chalk = require ( 'chalk' ) ;
6
6
const pageData = {
7
- id : data . questionId ,
7
+ id : data . questionFrontendId || data . questionId ,
8
8
name : data . questionTitle ,
9
9
difficulty : data . difficulty ,
10
10
relatedTopics : data . topicTags . map ( t => t . name ) . join ( ', ' ) ,
@@ -92,7 +92,7 @@ const getName = url => {
92
92
93
93
const queryAndCreate = name => {
94
94
const axios = require ( 'axios' ) ;
95
- const url = `https://leetcode.com/graphql?query=query%20getQuestionDetail($titleSlug:%20String!)%20%7B%0A%20%20question(titleSlug:%20$titleSlug)%20%7B%0A%20%20%20%20questionId%0A%20%20%20%20questionTitle%0A%20%20%20%20content%0A%20%20%20%20difficulty%0A%20%20%20%20stats%0A%20%20%20%20similarQuestions%0A%20%20%20%20topicTags%20%7B%0A%20%20%20%20%20%20name%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A&operationName=getQuestionDetail&variables=%7B%22titleSlug%22:%22${ name } %22%7D` ;
95
+ const url = `https://leetcode.com/graphql?query=query%20getQuestionDetail($titleSlug:%20String!)%20%7B%0A%20%20question(titleSlug:%20$titleSlug)%20%7B%0A%20%20%20%20questionId%0A%20%20%20%20questionFrontendId%0A%20%20%20% 20questionTitle%0A%20%20%20%20content%0A%20%20%20%20difficulty%0A%20%20%20%20stats%0A%20%20%20%20similarQuestions%0A%20%20%20%20topicTags%20%7B%0A%20%20%20%20%20%20name%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A&operationName=getQuestionDetail&variables=%7B%22titleSlug%22:%22${ name } %22%7D` ;
96
96
97
97
axios . get ( url ) . then ( res => {
98
98
create ( res . data . data . question ) ;
You can’t perform that action at this time.
0 commit comments