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:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user