add: journal.css special note
This commit is contained in:
parent
f0d1a1e8e4
commit
dc50f3a8af
8 changed files with 125 additions and 13 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue