summaryrefslogtreecommitdiff
path: root/src/index
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-09-15 22:25:48 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-09-15 22:25:48 -0400
commit8738cf083caaf9d8ecb1918e14712f7b09f490a5 (patch)
tree502fc6b6c9c6dadc9aeeb5c3867de06c296c0055 /src/index
parentae04a5605b939709552f9ecac91f00e734813980 (diff)
Move channel list into the `app.channels()` namespace.
This is groundwork for a JSON-based API, after a conversation with Kit.
Diffstat (limited to 'src/index')
-rw-r--r--src/index/app.rs8
-rw-r--r--src/index/routes.rs2
2 files changed, 1 insertions, 9 deletions
diff --git a/src/index/app.rs b/src/index/app.rs
index b315b45..fabf35c 100644
--- a/src/index/app.rs
+++ b/src/index/app.rs
@@ -14,14 +14,6 @@ impl<'a> Index<'a> {
Self { db }
}
- pub async fn for_authenticated(&self) -> Result<Vec<Channel>, BoxedError> {
- let mut tx = self.db.begin().await?;
- let channels = tx.channels().all().await?;
- tx.commit().await?;
-
- 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?;
diff --git a/src/index/routes.rs b/src/index/routes.rs
index 07b6001..2d77e5b 100644
--- a/src/index/routes.rs
+++ b/src/index/routes.rs
@@ -21,7 +21,7 @@ async fn index(State(app): State<App>, login: Option<Login>) -> Result<Markup, I
}
async fn index_authenticated(app: App, login: Login) -> Result<Markup, InternalError> {
- let channels = app.index().for_authenticated().await?;
+ let channels = app.channels().all().await?;
Ok(templates::authenticated(login, &channels))
}