diff options
author | yigit sever | 2021-04-16 13:40:17 +0000 |
---|---|---|
committer | yigit sever | 2021-04-16 13:40:17 +0000 |
commit | e81b6af56436be291adf31f770c6ef7e8ddfdbd0 (patch) | |
tree | b1d02cfccf1f3004f5a9e6bcc68dfef180c08150 /src/routes.rs | |
parent | c28b07a494ea39f91283601251061366a9f5e93e (diff) | |
parent | 204dbc1f887f42e4a5ea734895ef36c5c434890f (diff) | |
download | gradecoin-e81b6af56436be291adf31f770c6ef7e8ddfdbd0.tar.gz gradecoin-e81b6af56436be291adf31f770c6ef7e8ddfdbd0.tar.bz2 gradecoin-e81b6af56436be291adf31f770c6ef7e8ddfdbd0.zip |
Merge pull request 'Add existing user get support' (#1) from usershow into main
Reviewed-on: https://git.yigitsever.com/yigit/gradecoin/pulls/1
Diffstat (limited to 'src/routes.rs')
-rw-r--r-- | src/routes.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/routes.rs b/src/routes.rs index 52d357a..211f832 100644 --- a/src/routes.rs +++ b/src/routes.rs | |||
@@ -18,10 +18,19 @@ pub fn consensus_routes(db: Db) -> impl Filter<Extract = impl Reply, Error = Rej | |||
18 | .or(register_user(db.clone())) | 18 | .or(register_user(db.clone())) |
19 | .or(auth_transaction_propose(db.clone())) | 19 | .or(auth_transaction_propose(db.clone())) |
20 | .or(auth_block_propose(db.clone())) | 20 | .or(auth_block_propose(db.clone())) |
21 | .or(list_users(db.clone())) | ||
21 | .or(block_list(db)) | 22 | .or(block_list(db)) |
22 | .or(static_route) | 23 | .or(static_route) |
23 | } | 24 | } |
24 | 25 | ||
26 | /// GET /user warp route | ||
27 | pub fn list_users(db: Db) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { | ||
28 | warp::path!("user") | ||
29 | .and(warp::get()) | ||
30 | .and(custom_filters::with_db(db)) | ||
31 | .and_then(handlers::user_list_handler) | ||
32 | } | ||
33 | |||
25 | /// POST /register warp route | 34 | /// POST /register warp route |
26 | pub fn register_user(db: Db) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { | 35 | pub fn register_user(db: Db) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { |
27 | warp::path!("register") | 36 | warp::path!("register") |