add: journal.css special note

This commit is contained in:
trisua 2025-06-19 19:13:07 -04:00
parent f0d1a1e8e4
commit dc50f3a8af
8 changed files with 125 additions and 13 deletions

View file

@ -49,6 +49,20 @@ pub async fn get_request(
})
}
pub async fn get_css_request(
Path(id): Path<usize>,
Extension(data): Extension<State>,
) -> impl IntoResponse {
let data = &(data.read().await).0;
let note = match data.get_note_by_journal_title(id, "journal.css").await {
Ok(x) => x,
Err(e) => return ([("Content-Type", "text/plain")], format!("/* {e} */")),
};
([("Content-Type", "text/css")], note.content)
}
pub async fn list_request(jar: CookieJar, Extension(data): Extension<State>) -> impl IntoResponse {
let data = &(data.read().await).0;
let user = match get_user_from_token!(jar, data, oauth::AppScope::UserReadJournals) {