summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/handlers/conversation.rs (renamed from src/ui/handlers/channel.rs)11
-rw-r--r--src/ui/handlers/mod.rs4
2 files changed, 9 insertions, 6 deletions
diff --git a/src/ui/handlers/channel.rs b/src/ui/handlers/conversation.rs
index d3199dd..f1bb319 100644
--- a/src/ui/handlers/channel.rs
+++ b/src/ui/handlers/conversation.rs
@@ -5,7 +5,7 @@ use axum::{
use crate::{
app::App,
- channel::{self, app},
+ conversation::{self, app},
error::Internal,
token::extract::Identity,
ui::{
@@ -17,17 +17,20 @@ use crate::{
pub async fn handler(
State(app): State<App>,
identity: Option<Identity>,
- Path(channel): Path<channel::Id>,
+ Path(conversation): Path<conversation::Id>,
) -> Result<Asset, Error> {
let _ = identity.ok_or(Error::NotLoggedIn)?;
- app.channels().get(&channel).await.map_err(Error::from)?;
+ app.conversations()
+ .get(&conversation)
+ .await
+ .map_err(Error::from)?;
Assets::index().map_err(Error::Internal)
}
#[derive(Debug, thiserror::Error)]
pub enum Error {
- #[error("channel not found")]
+ #[error("conversation not found")]
NotFound,
#[error("not logged in")]
NotLoggedIn,
diff --git a/src/ui/handlers/mod.rs b/src/ui/handlers/mod.rs
index 5bfd0d6..ed0c14e 100644
--- a/src/ui/handlers/mod.rs
+++ b/src/ui/handlers/mod.rs
@@ -1,5 +1,5 @@
mod asset;
-mod channel;
+mod conversation;
mod index;
mod invite;
mod login;
@@ -7,7 +7,7 @@ mod me;
mod setup;
pub use asset::handler as asset;
-pub use channel::handler as channel;
+pub use conversation::handler as conversation;
pub use index::handler as index;
pub use invite::handler as invite;
pub use login::handler as login;