Risolto problema blocco

This commit is contained in:
Surya Paolo
2023-12-18 08:02:35 +01:00
parent c2af144c05
commit 265c8f4d9e
7 changed files with 160 additions and 132 deletions

View File

@@ -118,10 +118,13 @@ export default defineComponent({
}
function getnumstore() {
if (myproduct.value.storehouses)
return myproduct.value.storehouses.length
else
return 0
if (myproduct.value) {
if (myproduct.value.storehouses)
return myproduct.value.storehouses.length
else
return 0
}
return 0
}
function getSingleStorehouse() {
@@ -138,10 +141,13 @@ export default defineComponent({
function updateproduct() {
myproduct.value = products.getProduct(props.code)
products.updateQuantityAvailable(myproduct.value._id)
}
function getStorehouses() {
if (!myproduct.value)
return []
const myarr: any = []
let ind = 1
myproduct.value.storehouses.forEach((store) => {
@@ -165,7 +171,6 @@ export default defineComponent({
}
function getQtyAvailable() {
products.updateQuantityAvailable(myproduct.value._id)
let qty = myproduct.value.quantityAvailable!
return qty
}
@@ -188,7 +193,7 @@ export default defineComponent({
function load() {
updateproduct()
console.log('Load', myproduct.value.name)
// console.log('Load', myproduct.value.name)
// console.log('created Cproductcard', code)
arrordersCart.value = products.getOrdersCartByIdProduct(myproduct.value._id)
@@ -204,7 +209,7 @@ export default defineComponent({
}
}
console.log('°°° ENDLOAD °°°')
// console.log('°°° ENDLOAD °°°')
endload.value = true
}