diff options
Diffstat (limited to 'src/index/app.rs')
| -rw-r--r-- | src/index/app.rs | 10 |
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) + } } |
