aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes.rs
diff options
context:
space:
mode:
authoryigit sever2021-04-16 13:40:17 +0000
committeryigit sever2021-04-16 13:40:17 +0000
commitc6b90ff7abe2122fbac8f9e1066bd8cecbf135cd (patch)
tree9835fb758c15d1ed36b95b950e23bf883da87738 /src/routes.rs
parent9a9bc6522810d49a46f6762cca68daf81ba60390 (diff)
parente7cd705175abb820cd4bfdb28693615ef2171597 (diff)
downloadgradecoin-c6b90ff7abe2122fbac8f9e1066bd8cecbf135cd.tar.gz
gradecoin-c6b90ff7abe2122fbac8f9e1066bd8cecbf135cd.tar.bz2
gradecoin-c6b90ff7abe2122fbac8f9e1066bd8cecbf135cd.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.rs9
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
27pub 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
26pub fn register_user(db: Db) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { 35pub fn register_user(db: Db) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
27 warp::path!("register") 36 warp::path!("register")