Visual cleanup but also we're now dictating in main how the invites api should work now
This commit is contained in:
parent
f0209217de
commit
996a08f58a
@ -45,20 +45,14 @@ async fn route_dispatcher(pool: &Pool, resp: &mut Response<Body>, meth: &Method,
|
||||
// At some point we should have some way of hiding this obnoxious complexity
|
||||
use routes::resolve_dynamic_route;
|
||||
match (meth, path) {
|
||||
(&Method::GET, routes::INVITE_JOIN) => {
|
||||
if let Err(_) = invites::route_join_invite_code(pool, resp, params).await {
|
||||
*resp.status_mut() = StatusCode::INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
},
|
||||
(&Method::GET, routes::INVITE_CREATE) => {
|
||||
if let Err(_) = invites::create_invite(pool, resp).await {
|
||||
*resp.status_mut() = StatusCode::INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
},
|
||||
/* INVITES */
|
||||
(&Method::GET, routes::INVITE_JOIN) => invites::route_join_invite_code(pool, resp, params).await,
|
||||
(&Method::GET, routes::INVITE_CREATE) => { invites::create(pool, resp).await,
|
||||
/* CHANNELS */
|
||||
(&Method::GET, routes::CHANNELS_LIST) => channels::list_channels(pool, resp).await,
|
||||
(&Method::POST, routes::CHANNELS_CREATE) => channels::create_channel(pool, resp, params).await,
|
||||
(&Method::POST, routes::CHANNELS_DELETE) => channels::delete_channel(pool, resp, params).await,
|
||||
|
||||
/* MESSAGING */
|
||||
(&Method::POST, routes::MESSAGE_SEND) => messages::send_message(pool, resp, params).await,
|
||||
_ => {
|
||||
// We attempt dynamic routes as fallback for a few reasons
|
||||
|
Loading…
Reference in New Issue
Block a user