diff --git a/resources/js/components/button/RowShareAction.vue b/resources/js/components/button/RowShareAction.vue index bc0117b..a3cb932 100644 --- a/resources/js/components/button/RowShareAction.vue +++ b/resources/js/components/button/RowShareAction.vue @@ -37,26 +37,17 @@ const whatsappText = computed(() => { } if (c.results?.length) { - const groups: Record = {}; + const productNames = new Set(); c.results.forEach((result) => { const productName = result.product_variant?.product?.name ?? 'Produk Tidak Diketahui'; - - if (!groups[productName]) { - groups[productName] = { name: productName, items: [] }; - } - - groups[productName].items.push(result); + productNames.add(productName); }); text += `\n*Hasil Produk:*\n`; - Object.values(groups).forEach((group, index) => { - text += `${index + 1}. ${group.name}\n`; - - group.items.forEach((item) => { - text += ` - ${item.product_variant?.name ?? '-'}\n`; - }); + Array.from(productNames).forEach((name, index) => { + text += `${index + 1}. ${name}\n`; }); }