Skip to content

Commit

Permalink
fix(server): correct property data structure in response json
Browse files Browse the repository at this point in the history
  • Loading branch information
csulit committed Oct 18, 2024
1 parent a291ce1 commit 83deeb4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ app.get("/api/properties", async (c: Context) => {
app.get("/api/properties/:id", async (c: Context) => {
using client = await dbPool.connect();
const id = c.req.param("id");

if (!id) {
return c.json({ error: "Property ID is required" }, 400);
}
Expand Down Expand Up @@ -292,7 +292,7 @@ app.get("/api/properties/:id", async (c: Context) => {
`,
});

return c.json({ data: property });
return c.json({ data: property.rows[0] });
});

app.post("/", async (c: Context) => {
Expand Down

0 comments on commit 83deeb4

Please sign in to comment.