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();