Fixed stock status display on change api

The visual state did not show the actual status,
the hidden one for ChangeDetection did work correctly
This commit is contained in:
2026-04-04 23:43:04 +02:00
parent bf36266fa1
commit 9247b301a5

View File

@@ -100,8 +100,10 @@ app.get("/api/change", async (req, res) => {
if( quantity > 0 ) {
inStock = "InStock" ;
visualInStock = "In stock" ;
} else{
inStock = "OutOfStock" ;
visualStock = "Out of stock" ;
}
res.send(`
@@ -112,7 +114,7 @@ app.get("/api/change", async (req, res) => {
}
</style>
<h1>${product}</h1>
<p>Status: ${inStock ? "In Stock" : "Out of Stock"}</p>
<p>Status: ${visualStock}</p>
<!-- JSON-LD structured data for restock detection -->
<script type="application/ld+json">