Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-03-13 17:17:43 +03:00
parent 899b9fc7cc
commit f9a864d63c
2 changed files with 42 additions and 0 deletions

View File

@@ -1078,10 +1078,24 @@ async function openProductCard(grp1, grp2) {
await ensureProductImage(productCode, colorCode, secondColor)
let list = Array.isArray(productImageListByCode.value[listKey]) ? productImageListByCode.value[listKey] : []
console.info('[ProductStockByAttributes][openProductCard] request', {
productCode,
colorCode,
secondColor,
listKey,
cachedListCount: list.length
})
if (!list.length && codeTrim) {
try {
list = await fetchProductImageList(codeTrim, colorTrim, secondTrim)
productImageListByCode.value[listKey] = list
console.info('[ProductStockByAttributes][openProductCard] refetch', {
productCode: codeTrim,
dim1: colorTrim,
dim3: secondTrim,
fetchedCount: list.length,
fileNames: list.map((x) => String(x?.file_name || x?.FileName || '').trim()).filter(Boolean)
})
} catch (err) {
console.warn('[ProductStockByAttributes] product card image list refetch failed', {
code: codeTrim,
@@ -1096,6 +1110,13 @@ async function openProductCard(grp1, grp2) {
list.map((item) => resolveProductImageUrlForCarousel(item))
)
const images = imageCandidates.filter((x) => String(x || '').trim() !== '')
console.info('[ProductStockByAttributes][openProductCard] render', {
productCode,
colorCode,
secondColor,
candidateCount: imageCandidates.length,
imageCount: images.length
})
const uniqueImages = Array.from(new Set(images))
if (!uniqueImages.length) {

View File

@@ -950,10 +950,24 @@ async function openProductCard(grp1, grp2) {
await ensureProductImage(productCode, colorCode, secondColor)
let list = Array.isArray(productImageListByCode.value[listKey]) ? productImageListByCode.value[listKey] : []
console.info('[ProductStockQuery][openProductCard] request', {
productCode,
colorCode,
secondColor,
listKey,
cachedListCount: list.length
})
if (!list.length && codeTrim) {
try {
list = await fetchProductImageList(codeTrim, colorTrim, secondTrim)
productImageListByCode.value[listKey] = list
console.info('[ProductStockQuery][openProductCard] refetch', {
productCode: codeTrim,
dim1: colorTrim,
dim3: secondTrim,
fetchedCount: list.length,
fileNames: list.map((x) => String(x?.file_name || x?.FileName || '').trim()).filter(Boolean)
})
} catch (err) {
console.warn('[ProductStockQuery] product card image list refetch failed', {
code: codeTrim,
@@ -968,6 +982,13 @@ async function openProductCard(grp1, grp2) {
list.map((item) => resolveProductImageUrlForCarousel(item))
)
const images = imageCandidates.filter((x) => String(x || '').trim() !== '')
console.info('[ProductStockQuery][openProductCard] render', {
productCode,
colorCode,
secondColor,
candidateCount: imageCandidates.length,
imageCount: images.length
})
const uniqueImages = Array.from(new Set(images))
if (!uniqueImages.length) {