summaryrefslogtreecommitdiff
path: root/src/index/app.rs
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-09-14 00:16:51 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-09-14 00:18:08 -0400
commit5249aad35741f6f029c442a04d679937fb91d2bb (patch)
treec75085a93538367ae3f5da8f64f90b33a3c8feef /src/index/app.rs
parent407ca8df6284ce1a4c649b018c7326fd195bbd26 (diff)
Placeholder UX, probably
Diffstat (limited to 'src/index/app.rs')
-rw-r--r--src/index/app.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/index/app.rs b/src/index/app.rs
index 6075c6f..b315b45 100644
--- a/src/index/app.rs
+++ b/src/index/app.rs
@@ -1,7 +1,7 @@
use sqlx::sqlite::SqlitePool;
use crate::{
- channel::repo::channels::{Channel, Provider as _},
+ channel::repo::channels::{Channel, Id as ChannelId, Provider as _},
error::BoxedError,
};
@@ -21,4 +21,12 @@ impl<'a> Index<'a> {
Ok(channels)
}
+
+ pub async fn channel(&self, channel: ChannelId) -> Result<Channel, BoxedError> {
+ let mut tx = self.db.begin().await?;
+ let channel = tx.channels().by_id(channel).await?;
+ tx.commit().await?;
+
+ Ok(channel)
+ }
}