summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/handlers/conversation.rs7
-rw-r--r--src/ui/handlers/invite.rs6
-rw-r--r--src/ui/handlers/setup.rs7
3 files changed, 9 insertions, 11 deletions
diff --git a/src/ui/handlers/conversation.rs b/src/ui/handlers/conversation.rs
index f1bb319..2ff090c 100644
--- a/src/ui/handlers/conversation.rs
+++ b/src/ui/handlers/conversation.rs
@@ -4,8 +4,7 @@ use axum::{
};
use crate::{
- app::App,
- conversation::{self, app},
+ conversation::{self, app, app::Conversations},
error::Internal,
token::extract::Identity,
ui::{
@@ -15,12 +14,12 @@ use crate::{
};
pub async fn handler(
- State(app): State<App>,
+ State(conversations): State<Conversations>,
identity: Option<Identity>,
Path(conversation): Path<conversation::Id>,
) -> Result<Asset, Error> {
let _ = identity.ok_or(Error::NotLoggedIn)?;
- app.conversations()
+ conversations
.get(&conversation)
.await
.map_err(Error::from)?;
diff --git a/src/ui/handlers/invite.rs b/src/ui/handlers/invite.rs
index 0f9580a..edd6dc1 100644
--- a/src/ui/handlers/invite.rs
+++ b/src/ui/handlers/invite.rs
@@ -4,9 +4,9 @@ use axum::{
};
use crate::{
- app::App,
error::Internal,
invite,
+ invite::app::Invites,
ui::{
assets::{Asset, Assets},
error::NotFound,
@@ -14,10 +14,10 @@ use crate::{
};
pub async fn handler(
- State(app): State<App>,
+ State(invites): State<Invites>,
Path(invite): Path<invite::Id>,
) -> Result<Asset, Error> {
- app.invites()
+ invites
.get(&invite)
.await
.map_err(Error::internal)?
diff --git a/src/ui/handlers/setup.rs b/src/ui/handlers/setup.rs
index 49821cf..5707765 100644
--- a/src/ui/handlers/setup.rs
+++ b/src/ui/handlers/setup.rs
@@ -4,14 +4,13 @@ use axum::{
};
use crate::{
- app::App,
error::Internal,
+ setup::app::Setup,
ui::assets::{Asset, Assets},
};
-pub async fn handler(State(app): State<App>) -> Result<Asset, Error> {
- if app
- .setup()
+pub async fn handler(State(setup): State<Setup>) -> Result<Asset, Error> {
+ if setup
.completed()
.await
.map_err(Internal::from)