This repository was archived by the owner on Sep 10, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
crates/handlers/src/admin/v1/users Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -96,8 +96,10 @@ impl IntoResponse for RouteError {
96
96
}
97
97
}
98
98
99
+ /// # JSON payload for the `POST /api/admin/v1/users` endpoint
99
100
#[ derive( Deserialize , JsonSchema ) ]
100
- pub struct AddUserParams {
101
+ #[ serde( rename = "AddUserRequest" ) ]
102
+ pub struct Request {
101
103
/// The username of the user to add.
102
104
username : String ,
103
105
@@ -141,7 +143,7 @@ pub async fn handler(
141
143
} : CallContext ,
142
144
NoApi ( mut rng) : NoApi < BoxRng > ,
143
145
State ( homeserver) : State < BoxHomeserverConnection > ,
144
- Json ( params) : Json < AddUserParams > ,
146
+ Json ( params) : Json < Request > ,
145
147
) -> Result < Json < SingleResponse < User > > , RouteError > {
146
148
if repo. user ( ) . exists ( & params. username ) . await ? {
147
149
return Err ( RouteError :: UserAlreadyExists ) ;
Original file line number Diff line number Diff line change 169
169
"content" : {
170
170
"application/json" : {
171
171
"schema" : {
172
- "$ref" : " #/components/schemas/AddUserParams "
172
+ "$ref" : " #/components/schemas/AddUserRequest "
173
173
}
174
174
}
175
175
},
637
637
}
638
638
}
639
639
},
640
- "AddUserParams" : {
640
+ "AddUserRequest" : {
641
+ "title" : " JSON payload for the `POST /api/admin/v1/users` endpoint" ,
641
642
"type" : " object" ,
642
643
"required" : [
643
644
" username"
You can’t perform that action at this time.
0 commit comments