diff --git a/server/src/routes.rs b/server/src/routes.rs index 1ae9f51..d5d5e0a 100644 --- a/server/src/routes.rs +++ b/server/src/routes.rs @@ -1,6 +1,5 @@ pub const INVITE_JOIN: &'static str = "/invite/join"; // requires @code pub const INVITE_CREATE: &'static str = "/invite/create"; // requires none -pub const INVITE_USE_BASE: &'static str = "/invite/join"; // no quth pub const CHANNELS_LIST: &'static str = "/channels/list"; // requires none pub const CHANNELS_CREATE: &'static str = "/channels/create"; // requires @name @description @@ -11,16 +10,11 @@ const DYNAMIC_ROUTE_BASES: [&'static str;1] = [ "/invites" ]; -struct DynRoute { - base: String, - dynamic: String, +pub struct DynRoute { + pub base: String, + pub dynamic: String, } -impl DynRoute { - fn to_parts(&self) -> (String, String) { - (self.base, self.dynamic) - } -} pub fn resolve_dynamic_route(uri: &str) -> Option { let mut valid = false; @@ -33,10 +27,9 @@ pub fn resolve_dynamic_route(uri: &str) -> Option { } } if valid { - // split the thing now Some(DynRoute { base: base_ref.into(), - dynamic: "asdf".into() + dynamic: uri.to_string().replace(base_ref, "") }) } else {