From 5249aad35741f6f029c442a04d679937fb91d2bb Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Sat, 14 Sep 2024 00:16:51 -0400 Subject: Placeholder UX, probably --- src/index/app.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/index/app.rs') 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 { + let mut tx = self.db.begin().await?; + let channel = tx.channels().by_id(channel).await?; + tx.commit().await?; + + Ok(channel) + } } -- cgit v1.2.3