From 483d7eea1d6c6875d0cda1fc7635610cce345e91 Mon Sep 17 00:00:00 2001 From: Adam <24621027+adoyle0@users.noreply.github.com> Date: Thu, 18 Jan 2024 17:39:20 -0500 Subject: [PATCH] path is an argument --- doordesk/app/src/components/slingshot.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doordesk/app/src/components/slingshot.rs b/doordesk/app/src/components/slingshot.rs index 8760206..b84602a 100644 --- a/doordesk/app/src/components/slingshot.rs +++ b/doordesk/app/src/components/slingshot.rs @@ -10,11 +10,10 @@ pub struct ArticleData { } #[server] -pub async fn slingshot() -> Result, ServerFnError> { +pub async fn slingshot(path: String) -> Result, ServerFnError> { let mut articles = vec![]; - let data_dir = "./pubic/static"; - for dir in std::fs::read_dir(data_dir)? { + for dir in std::fs::read_dir(path)? { for file in std::fs::read_dir(dir?.path())? { let fileinfo = file?; let filepath = fileinfo.path();