This repository was archived by the owner on Jul 7, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-24
lines changed Expand file tree Collapse file tree 1 file changed +9
-24
lines changed Original file line number Diff line number Diff line change @@ -108,31 +108,16 @@ impl LeetCode {
108
108
. await
109
109
}
110
110
111
- /// TODO: check if refer is necessary
112
- #[ named]
113
111
pub async fn get_question_ids_by_tag ( & self , slug : & str ) -> Result < Response , Error > {
114
- trace ! ( "Requesting {} ref problems..." , & slug) ;
115
- let url = & self . conf . sys . urls . get ( "graphql" ) . ok_or ( Error :: NoneError ) ?;
116
- let mut json: Json = HashMap :: new ( ) ;
117
- json. insert ( "operationName" , "a" . to_string ( ) ) ;
118
- json. insert ( "variables" , r#"{"slug": "$slug"}"# . replace ( "$slug" , slug) ) ;
119
- json. insert (
120
- "query" ,
121
- "query a($slug: String!) {
122
- topicTag(slug: $slug) {
123
- questions {
124
- questionId
125
- }
126
- }
127
- }" . to_owned ( )
128
- ) ;
129
-
130
- let mut req = make_req ! ( self , url. to_string( ) ) ;
131
- req. mode = Mode :: Post ( json) ;
132
- req. refer = Some ( ( self . conf . sys . urls . get ( "tag" ) . ok_or ( Error :: NoneError ) ?) . replace ( "$slug" , slug) ) ;
133
- req
134
- . send ( & self . client )
135
- . await
112
+ self . get_graphql ( "query a {
113
+ topicTag(slug: \" $slug\" ) {
114
+ questions {
115
+ questionId
116
+ }
117
+ }
118
+ }"
119
+ . replace ( "$slug" , slug) ,
120
+ None ) . await
136
121
}
137
122
138
123
/// Get user info
You can’t perform that action at this time.
0 commit comments