summary refs log tree commit diff
path: root/src/actions/page.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions/page.rs')
-rw-r--r--src/actions/page.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/actions/page.rs b/src/actions/page.rs
index c51e6bc..8d204f5 100644
--- a/src/actions/page.rs
+++ b/src/actions/page.rs
@@ -1,2 +1,12 @@
+use leptos::prelude::*;
+
 #[server]
-pub async fn get_page_content()
+pub async fn get_page_content(url_path: String) -> Result<(), ServerFnError> {
+    use crate::data::content::ContentController;
+    let content_controller = expect_context::<ContentController>();
+    let content_snapshot = content_controller.get_snapshot().await;
+    let page_uuid = content_snapshot.page_paths.get(&url_path);
+    let page = content_snapshot.pages.get(&page_uuid.unwrap());
+
+    return Ok(())
+}