diff --git a/app/src/components/NodeDisplay.module.scss b/app/src/components/NodeDisplay.module.scss index 3c80077..c012c94 100644 --- a/app/src/components/NodeDisplay.module.scss +++ b/app/src/components/NodeDisplay.module.scss @@ -1,9 +1,18 @@ .container { - max-width: 400px; + width: 400px; overflow-wrap: break-word; overflow-y: auto; border: 1px solid lightgray; + border-radius: 4px; +} +.header { + padding: 2px 12px; + background-color: lightgray; + color: gray; +} + +.body { padding: 12px; } \ No newline at end of file diff --git a/app/src/components/NodeDisplay.tsx b/app/src/components/NodeDisplay.tsx index aef9edb..c40e7b0 100644 --- a/app/src/components/NodeDisplay.tsx +++ b/app/src/components/NodeDisplay.tsx @@ -10,15 +10,33 @@ export default function NodeDisplay({ id }: NodeDisplayProps) { queryKey: ["fetchNode", id], queryFn: async () => { const resp = await fetch(`http://localhost:5195/node/${id}`); - console.log("id", resp); - return "helloge"; + const json = await resp.json(); + return json; }, }); + const { isSuccess, status, data } = query; return (
{JSON.stringify(query)}
+{JSON.stringify(data)}
+ > + ); +} diff --git a/crates/panorama-daemon/src/error.rs b/crates/panorama-daemon/src/error.rs index 7feba6b..d87307e 100644 --- a/crates/panorama-daemon/src/error.rs +++ b/crates/panorama-daemon/src/error.rs @@ -12,6 +12,7 @@ pub struct AppError(miette::Report); // Tell axum how to convert `AppError` into a response. impl IntoResponse for AppError { fn into_response(self) -> Response { + eprintln!("Encountered error: {}", self.0); ( StatusCode::INTERNAL_SERVER_ERROR, format!("Something went wrong: {}", self.0), diff --git a/crates/panorama-daemon/src/main.rs b/crates/panorama-daemon/src/main.rs index 3e2f09d..bb2d63d 100644 --- a/crates/panorama-daemon/src/main.rs +++ b/crates/panorama-daemon/src/main.rs @@ -56,7 +56,7 @@ async fn main() -> Result<()> { // build our application with a single route let app = Router::new() .route("/", get(|| async { "Hello, World!" })) - .route("/node/{id}", get(get_node)) + .route("/node/:id", get(get_node)) .route("/journal/get_todays_journal_id", get(get_todays_journal_id)) .layer(ServiceBuilder::new().layer(cors)) .with_state(state); diff --git a/crates/panorama-daemon/src/node.rs b/crates/panorama-daemon/src/node.rs index b8efd14..c733f93 100644 --- a/crates/panorama-daemon/src/node.rs +++ b/crates/panorama-daemon/src/node.rs @@ -13,15 +13,31 @@ pub async fn get_node( ) -> AppResult