feat: scratchpad

additional improvements

changelog

fix: wording
This commit is contained in:
Per Stark
2025-10-22 11:53:17 +02:00
parent 07b3e1a0e8
commit 3b805778b4
18 changed files with 1565 additions and 106 deletions
+40
View File
@@ -0,0 +1,40 @@
mod handlers;
use axum::{
extract::FromRef,
routing::{delete, get, patch, post},
Router,
};
use crate::html_state::HtmlState;
pub fn router<S>() -> Router<S>
where
S: Clone + Send + Sync + 'static,
HtmlState: FromRef<S>,
{
Router::new()
.route("/scratchpad", get(handlers::show_scratchpad_page))
.route("/scratchpad", post(handlers::create_scratchpad))
.route(
"/scratchpad/{id}/modal",
get(handlers::show_scratchpad_modal),
)
.route(
"/scratchpad/{id}/auto-save",
patch(handlers::auto_save_scratchpad),
)
.route(
"/scratchpad/{id}/title",
patch(handlers::update_scratchpad_title),
)
.route("/scratchpad/{id}", delete(handlers::delete_scratchpad))
.route(
"/scratchpad/{id}/archive",
post(handlers::archive_scratchpad),
)
.route("/scratchpad/{id}/ingest", post(handlers::ingest_scratchpad))
.route(
"/scratchpad/{id}/restore",
post(handlers::restore_scratchpad),
)
}