summaryrefslogtreecommitdiff
path: root/src/ui/handlers/me.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/handlers/me.rs')
-rw-r--r--src/ui/handlers/me.rs18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/ui/handlers/me.rs b/src/ui/handlers/me.rs
index 2fcb51c..de0b2b0 100644
--- a/src/ui/handlers/me.rs
+++ b/src/ui/handlers/me.rs
@@ -1,22 +1,20 @@
use axum::response::{self, IntoResponse, Redirect};
+use axum_extra::TypedHeader;
+use headers::IfNoneMatch;
-use crate::{
- error::Internal,
- token::extract::Identity,
- ui::assets::{Asset, Assets},
-};
+use crate::{error::Internal, token::extract::Identity, ui::assets::Response};
-pub async fn handler(identity: Option<Identity>) -> Result<Asset, Error> {
+pub async fn handler(
+ identity: Option<Identity>,
+ TypedHeader(if_none_match): TypedHeader<IfNoneMatch>,
+) -> Result<Response, Error> {
let _ = identity.ok_or(Error::NotLoggedIn)?;
- Assets::index().map_err(Error::Internal)
+ Response::index(&if_none_match).map_err(Error::Internal)
}
-#[derive(Debug, thiserror::Error)]
pub enum Error {
- #[error("not logged in")]
NotLoggedIn,
- #[error("{0}")]
Internal(Internal),
}