update
This commit is contained in:
parent
abaa9f12c9
commit
b00424471c
15 changed files with 52 additions and 68 deletions
|
@ -1,7 +1,8 @@
|
|||
use crate::library::user::Session;
|
||||
use crate::library::user::User;
|
||||
use crate::route::to_api;
|
||||
use mongod::vec_to_api;
|
||||
use mongod::Model;
|
||||
use mongod::ToAPI;
|
||||
use mongodb::bson::doc;
|
||||
use rocket::get;
|
||||
use rocket::http::Status;
|
||||
|
@ -83,7 +84,7 @@ pub async fn passwd_route(passwd: Json<PasswdData>, u: User) -> FallibleApiRespo
|
|||
pub async fn users_route(u: User) -> FallibleApiResponse {
|
||||
check_admin!(u);
|
||||
|
||||
let users: Vec<_> = to_api(&User::find_all().await.unwrap()).await;
|
||||
let users: Vec<_> = vec_to_api(&User::find_all().await.unwrap()).await;
|
||||
|
||||
Ok(json!({"users": users}))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue