diff --git a/proyek-frontend/app/components/templates/Ultah/Gallery.vue b/proyek-frontend/app/components/templates/Ultah/Gallery.vue index b8a8a76..63d361c 100644 --- a/proyek-frontend/app/components/templates/Ultah/Gallery.vue +++ b/proyek-frontend/app/components/templates/Ultah/Gallery.vue @@ -27,6 +27,9 @@ const props = defineProps({ required: true } }) + +console.log('Gallery props images:', props.images) + diff --git a/proyek-frontend/app/components/undangan/undangan-ulang-tahun-premium.vue b/proyek-frontend/app/components/undangan/undangan-ulang-tahun-premium.vue index 45fe03e..96c948d 100644 --- a/proyek-frontend/app/components/undangan/undangan-ulang-tahun-premium.vue +++ b/proyek-frontend/app/components/undangan/undangan-ulang-tahun-premium.vue @@ -29,13 +29,12 @@ + :childPhoto="formData.foto && formData.foto.length ? `${backendUrl}/storage/${formData.foto[4]}` : null" /> + @@ -70,6 +69,10 @@ const props = defineProps({ data: { type: Object, required: true } }) + + + + // Runtime config const config = useRuntimeConfig() const backendUrl = config.public.apiBaseUrl @@ -77,19 +80,32 @@ const backendUrl = config.public.apiBaseUrl // Data form dari backend const formData = computed(() => props.data.form || {}) -// Gabungkan semua foto jadi array untuk galeri + const galleryImages = computed(() => { + const f = formData.value.foto + + + if (Array.isArray(f)) { + return f.map(img => `${backendUrl}/storage/${img}`) + } + + // Jika masih bentuk lama (foto_1, foto_2, dst.) return [ formData.value.foto_1, formData.value.foto_2, formData.value.foto_3, formData.value.foto_4, formData.value.foto_5 - ] - .filter(Boolean) - .map(f => `${backendUrl}/${f}`) + ].filter(Boolean).map(img => `${backendUrl}/${img}`) }) +watchEffect(() => { + console.log("🧾 formData:", formData.value) + console.log("🖼️ galleryImages:", galleryImages.value) +}) + + + // Navigasi antar section const currentSection = ref('landing') const switchSection = (s) => (currentSection.value = s)