summary refs log tree commit diff
path: root/src/actions
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/mod.rs1
-rw-r--r--src/actions/page.rs12
2 files changed, 12 insertions, 1 deletions
diff --git a/src/actions/mod.rs b/src/actions/mod.rs
new file mode 100644
index 0000000..79d2861
--- /dev/null
+++ b/src/actions/mod.rs
@@ -0,0 +1 @@
+pub mod page;
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(())
+}