diff --git a/app.js b/app.js index eab5431..4aea53c 100644 --- a/app.js +++ b/app.js @@ -95,7 +95,7 @@ app.get("/api/building/:id", async (req, res) => { } const [nextLevel] = await db.query( - "SELECT required_points FROM building_levels WHERE building_id=? AND level=?", + "SELECT required_points, wood, stone FROM building_levels WHERE building_id=? AND level=?", [buildingId, building.level + 1], ); @@ -111,7 +111,7 @@ app.get("/api/building/:id", async (req, res) => { nextLevelPoints: nextLevel[0]?.required_points || null, description: info[0].description, history: info[0].history, - upgradeCost: "500 Holz, 200 Stein", + upgradeCost: `${nextLevel[0]?.wood} Holz, ${nextLevel[0]?.stone} Stein`, }); } catch (err) { console.error(err);