Skip to content

Commit

Permalink
data should be map
Browse files Browse the repository at this point in the history
  • Loading branch information
amitu committed Dec 19, 2024
1 parent 6d432a8 commit 0bde415
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion v0.5/fastn-router/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ pub struct Document {
pub enum RouterError {}

impl Document {
pub fn with_data(self, _data: &[u8]) -> Result<(String, serde_json::Value), RouterError> {
pub fn with_data(
self,
_data: &[u8],
) -> Result<(String, serde_json::Map<String, serde_json::Value>), RouterError> {
todo!()
}
}
6 changes: 5 additions & 1 deletion v0.5/fastn/src/commands/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ impl fastn::commands::Render {
}
}

pub async fn render_document(path: &str, _data: serde_json::Value, _strict: bool) -> String {
pub async fn render_document(
path: &str,
_data: serde_json::Map<String, serde_json::Value>,
_strict: bool,
) -> String {
let source = std::fs::File::open(path)
.and_then(std::io::read_to_string)
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion v0.5/fastn/src/commands/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async fn render(
fastn::commands::render::render_document(
// global_aliases,
"index.ftd",
serde_json::Value::Null,
serde_json::Map::new(),
false,
)
.await
Expand Down

0 comments on commit 0bde415

Please sign in to comment.