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