aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes.rs
diff options
context:
space:
mode:
authorYigit Sever2021-04-16 16:39:23 +0300
committerYigit Sever2021-04-16 16:39:23 +0300
commite7cd705175abb820cd4bfdb28693615ef2171597 (patch)
treef566559baf0dd3aadd4caad0f8929c26a6463309 /src/routes.rs
parent764aede8aae695981ee00c1aea3e82253aca02b7 (diff)
downloadgradecoin-e7cd705175abb820cd4bfdb28693615ef2171597.tar.gz
gradecoin-e7cd705175abb820cd4bfdb28693615ef2171597.tar.bz2
gradecoin-e7cd705175abb820cd4bfdb28693615ef2171597.zip
Add existing user get support
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")