@@ -5,24 +5,21 @@ use actix_web::{
5
5
HttpRequest , Responder ,
6
6
web:: { Data , Json , Path } ,
7
7
} ;
8
- use tracing:: info;
9
- use tracing:: instrument;
10
-
11
8
use htsget_http:: { Endpoint , PostRequest , post} ;
12
9
use htsget_search:: HtsGet ;
10
+ use tracing:: info;
11
+ use tracing:: instrument;
13
12
13
+ use super :: { extract_request, handle_response} ;
14
14
use crate :: AppState ;
15
- use crate :: handlers:: extract_request;
16
-
17
- use super :: handle_response;
18
15
19
16
/// POST request reads endpoint
20
17
#[ instrument( skip( app_state) ) ]
21
18
pub async fn reads < H : HtsGet + Clone + Send + Sync + ' static > (
22
19
request : Query < HashMap < String , String > > ,
23
- body : Json < PostRequest > ,
24
20
path : Path < String > ,
25
21
http_request : HttpRequest ,
22
+ body : Json < PostRequest > ,
26
23
app_state : Data < AppState < H > > ,
27
24
) -> impl Responder {
28
25
let request = extract_request ( request, path, http_request) ;
@@ -35,6 +32,7 @@ pub async fn reads<H: HtsGet + Clone + Send + Sync + 'static>(
35
32
body. into_inner ( ) ,
36
33
request,
37
34
Endpoint :: Reads ,
35
+ app_state. auth . clone ( ) ,
38
36
)
39
37
. await ,
40
38
)
@@ -44,9 +42,9 @@ pub async fn reads<H: HtsGet + Clone + Send + Sync + 'static>(
44
42
#[ instrument( skip( app_state) ) ]
45
43
pub async fn variants < H : HtsGet + Clone + Send + Sync + ' static > (
46
44
request : Query < HashMap < String , String > > ,
47
- body : Json < PostRequest > ,
48
45
path : Path < String > ,
49
46
http_request : HttpRequest ,
47
+ body : Json < PostRequest > ,
50
48
app_state : Data < AppState < H > > ,
51
49
) -> impl Responder {
52
50
let request = extract_request ( request, path, http_request) ;
@@ -59,6 +57,7 @@ pub async fn variants<H: HtsGet + Clone + Send + Sync + 'static>(
59
57
body. into_inner ( ) ,
60
58
request,
61
59
Endpoint :: Variants ,
60
+ app_state. auth . clone ( ) ,
62
61
)
63
62
. await ,
64
63
)
0 commit comments