update todo_app_sqlite_csrs

This commit is contained in:
Greg Johnston 2024-01-10 12:47:09 -05:00
parent c7941f7639
commit 7f532cda70
1 changed files with 2 additions and 3 deletions

View File

@ -20,11 +20,10 @@ pub async fn db() -> Result<SqliteConnection, ServerFnError> {
Ok(SqliteConnection::connect("sqlite:Todos.db").await?)
}
#[server(GetTodos, "/api")]
#[server]
pub async fn get_todos() -> Result<Vec<Todo>, ServerFnError> {
// this is just an example of how to access server context injected in the handlers
// http::Request doesn't implement Clone, so more work will be needed to do use_context() on this
let req_parts = use_context::<leptos_axum::RequestParts>();
let req_parts = use_context::<http::request::Parts>();
if let Some(req_parts) = req_parts {
println!("Uri = {:?}", req_parts.uri);