2
2
3
3
use std:: sync:: Arc ;
4
4
5
- use poem:: web:: { Data , Path } ;
6
- use poem_openapi:: { param:: Query , payload:: Json , OpenApi } ;
5
+ use poem:: web:: Data ;
6
+ use poem_openapi:: {
7
+ param:: { Path , Query } ,
8
+ payload:: Json ,
9
+ OpenApi ,
10
+ } ;
7
11
8
12
use crate :: {
9
13
service:: {
10
14
common:: {
11
- objects:: { account_votes:: AccountId , fragments_batch:: FragmentsBatch } ,
15
+ objects:: {
16
+ account_votes:: AccountId , fragments_batch:: FragmentsBatch ,
17
+ fragments_processing_summary:: FragmentId ,
18
+ } ,
12
19
tags:: ApiTags ,
13
20
} ,
14
21
utilities:: middleware:: schema_validation:: schema_version_validation,
@@ -31,10 +38,15 @@ impl V1Api {
31
38
operation_id = "AccountVotes" ,
32
39
transform = "schema_version_validation"
33
40
) ]
41
+
42
+ /// Get Account Votes
43
+ ///
34
44
/// Get from all active vote plans, the index of the voted proposals
35
- /// by th given account ID.
45
+ /// by the given account ID.
36
46
async fn get_account_votes (
37
- & self , state : Data < & Arc < State > > , account_id : Path < AccountId > ,
47
+ & self , state : Data < & Arc < State > > ,
48
+ /// A account ID to get the votes for.
49
+ account_id : Path < AccountId > ,
38
50
) -> account_votes_get:: AllResponses {
39
51
account_votes_get:: endpoint ( state, account_id) . await
40
52
}
@@ -73,7 +85,9 @@ impl V1Api {
73
85
& self ,
74
86
/// Comma-separated list of fragment ids for which the statuses will
75
87
/// be retrieved.
76
- Query ( fragment_ids) : Query < fragments_statuses:: FragmentIds > ,
88
+ // TODO (Blue) : https://github.com/input-output-hk/catalyst-voices/issues/239
89
+ #[ oai( validator( max_items = "1000" ) ) ]
90
+ Query ( fragment_ids) : Query < Vec < FragmentId > > ,
77
91
) -> fragments_statuses:: AllResponses {
78
92
fragments_statuses:: endpoint ( fragment_ids) . await
79
93
}
0 commit comments