File tree 1 file changed +9
-1
lines changed 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,12 @@ pub async fn delete_tables(
104
104
Ok ( StatusCode :: OK )
105
105
}
106
106
107
+ #[ derive( Deserialize ) ]
108
+ #[ serde( rename_all = "camelCase" ) ]
109
+ pub struct GetIndexesArgs {
110
+ component_id : Option < String > ,
111
+ }
112
+
107
113
#[ derive( Serialize ) ]
108
114
#[ serde( rename_all = "camelCase" ) ]
109
115
struct GetIndexesResponse {
@@ -114,11 +120,13 @@ struct GetIndexesResponse {
114
120
pub async fn get_indexes (
115
121
State ( st) : State < LocalAppState > ,
116
122
ExtractIdentity ( identity) : ExtractIdentity ,
123
+ Query ( GetIndexesArgs { component_id } ) : Query < GetIndexesArgs > ,
117
124
) -> Result < impl IntoResponse , HttpResponseError > {
118
125
must_be_admin_member ( & identity) ?;
126
+ let component_id = ComponentId :: deserialize_from_string ( component_id. as_deref ( ) ) ?;
119
127
let mut tx = st. application . begin ( identity. clone ( ) ) . await ?;
120
128
let indexes = IndexModel :: new ( & mut tx)
121
- . get_application_indexes ( TableNamespace :: TODO ( ) )
129
+ . get_application_indexes ( TableNamespace :: from ( component_id ) )
122
130
. await ?;
123
131
Ok ( Json ( GetIndexesResponse {
124
132
indexes : indexes
You can’t perform that action at this time.
0 commit comments