File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ pub async fn get_question_details(
15
15
client : & reqwest:: Client ,
16
16
_conn : & DatabaseConnection ,
17
17
) -> TaskResponse {
18
- match QuestionGQLQuery :: new ( slug) . post ( client) . await {
18
+ match QuestionGQLQuery :: new ( slug) . send ( client) . await {
19
19
Ok ( resp) => {
20
20
let query_response = resp;
21
21
TaskResponse :: QuestionDetail ( Response {
@@ -39,7 +39,7 @@ pub async fn get_editor_data(
39
39
client : & reqwest:: Client ,
40
40
_conn : & DatabaseConnection ,
41
41
) -> TaskResponse {
42
- match QuestionEditorDataQuery :: new ( slug) . post ( client) . await {
42
+ match QuestionEditorDataQuery :: new ( slug) . send ( client) . await {
43
43
Ok ( data) => TaskResponse :: QuestionEditorData ( Response {
44
44
request_id,
45
45
content : data. data . question ,
@@ -109,7 +109,7 @@ pub async fn run_or_submit_question(
109
109
} ) = & mut run_or_submit_code
110
110
{
111
111
match graphql:: console_panel_config:: Query :: new ( slug. clone ( ) )
112
- . post ( client)
112
+ . send ( client)
113
113
. await
114
114
{
115
115
Ok ( resp) => {
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ pub trait GQLLeetcodeQuery: Serialize + Sync {
30
30
"https://leetcode.com/graphql" . to_string ( )
31
31
}
32
32
33
- async fn post ( & self , client : & reqwest:: Client ) -> AppResult < Self :: T > {
33
+ async fn send ( & self , client : & reqwest:: Client ) -> AppResult < Self :: T > {
34
34
let request = if self . is_post ( ) {
35
35
client. post ( self . get_endpoint ( ) ) . json ( & self . get_body ( ) )
36
36
} else {
@@ -64,9 +64,9 @@ impl RunOrSubmitCode {
64
64
client : & reqwest:: Client ,
65
65
body : & impl GQLLeetcodeQuery < T = T > ,
66
66
) -> AppResult < ParsedResponse > {
67
- let run_response: T = body. post ( client) . await ?;
67
+ let run_response: T = body. send ( client) . await ?;
68
68
loop {
69
- let status_check = run_response. post ( client) . await ?;
69
+ let status_check = run_response. send ( client) . await ?;
70
70
let parsed_response = status_check. to_parsed_response ( ) ?;
71
71
match parsed_response {
72
72
ParsedResponse :: Pending => { }
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ pub async fn update_database_questions(
10
10
database_client : & DatabaseConnection ,
11
11
) -> AppResult < ( ) > {
12
12
let query = QuestionDbQuery :: default ( ) ;
13
- let query_response = query. post ( client) . await ?;
13
+ let query_response = query. send ( client) . await ?;
14
14
let total_questions = query_response. get_total_questions ( ) ;
15
15
let chunk_size: usize = 100 ;
16
16
let total_range = ( 0 ..total_questions) . collect :: < Vec < _ > > ( ) ;
@@ -19,7 +19,7 @@ pub async fn update_database_questions(
19
19
let client_copy = client. clone ( ) ;
20
20
let db_client_copy = database_client. clone ( ) ;
21
21
let resp = QuestionDbQuery :: new ( chunk. len ( ) as i32 , * skip)
22
- . post ( & client_copy)
22
+ . send ( & client_copy)
23
23
. await ?;
24
24
let questions = resp. get_questions ( ) ;
25
25
Question :: multi_insert ( & db_client_copy, questions) . await ?;
You can’t perform that action at this time.
0 commit comments