diff --git a/proyek-frontend/app/components/template-page/CategorySelection.vue b/proyek-frontend/app/components/template-page/CategorySelection.vue index 098045f..3bf9268 100644 --- a/proyek-frontend/app/components/template-page/CategorySelection.vue +++ b/proyek-frontend/app/components/template-page/CategorySelection.vue @@ -14,7 +14,7 @@ Kembali ke Beranda - +

Pilih Kategori Favoritmu diff --git a/proyek-frontend/app/components/templates/Ultah/Event.vue b/proyek-frontend/app/components/templates/Ultah/Event.vue index 9d305bf..2a8e6f6 100644 --- a/proyek-frontend/app/components/templates/Ultah/Event.vue +++ b/proyek-frontend/app/components/templates/Ultah/Event.vue @@ -1,27 +1,191 @@ + + + + diff --git a/proyek-frontend/app/components/templates/Ultah/Gallery.vue b/proyek-frontend/app/components/templates/Ultah/Gallery.vue index 6e5b839..b8a8a76 100644 --- a/proyek-frontend/app/components/templates/Ultah/Gallery.vue +++ b/proyek-frontend/app/components/templates/Ultah/Gallery.vue @@ -1,15 +1,36 @@ + + + + diff --git a/proyek-frontend/app/components/templates/Ultah/Introduction.vue b/proyek-frontend/app/components/templates/Ultah/Introduction.vue index 65e5e2c..1adb315 100644 --- a/proyek-frontend/app/components/templates/Ultah/Introduction.vue +++ b/proyek-frontend/app/components/templates/Ultah/Introduction.vue @@ -28,10 +28,10 @@ diff --git a/proyek-frontend/app/components/templates/Ultah/ThankYou.vue b/proyek-frontend/app/components/templates/Ultah/ThankYou.vue index dbb8e4e..89d9f99 100644 --- a/proyek-frontend/app/components/templates/Ultah/ThankYou.vue +++ b/proyek-frontend/app/components/templates/Ultah/ThankYou.vue @@ -1,20 +1,68 @@ + + diff --git a/proyek-frontend/app/components/templates/Ultah/UltahA.vue b/proyek-frontend/app/components/templates/Ultah/UltahA.vue index 6b0d59a..85c494d 100644 --- a/proyek-frontend/app/components/templates/Ultah/UltahA.vue +++ b/proyek-frontend/app/components/templates/Ultah/UltahA.vue @@ -1,769 +1,31 @@ - - \ No newline at end of file diff --git a/proyek-frontend/app/components/shared/CountdownTimer.vue b/proyek-frontend/app/components/templates/wedding/CountdownTimer.vue similarity index 100% rename from proyek-frontend/app/components/shared/CountdownTimer.vue rename to proyek-frontend/app/components/templates/wedding/CountdownTimer.vue diff --git a/proyek-frontend/app/components/shared/Gallery.vue b/proyek-frontend/app/components/templates/wedding/Gallery.vue similarity index 100% rename from proyek-frontend/app/components/shared/Gallery.vue rename to proyek-frontend/app/components/templates/wedding/Gallery.vue diff --git a/proyek-frontend/app/components/shared/GuestBook.vue b/proyek-frontend/app/components/templates/wedding/GuestBook.vue similarity index 100% rename from proyek-frontend/app/components/shared/GuestBook.vue rename to proyek-frontend/app/components/templates/wedding/GuestBook.vue diff --git a/proyek-frontend/app/components/shared/Maps.vue b/proyek-frontend/app/components/templates/wedding/Maps.vue similarity index 100% rename from proyek-frontend/app/components/shared/Maps.vue rename to proyek-frontend/app/components/templates/wedding/Maps.vue diff --git a/proyek-frontend/app/components/shared/MusicPlayer.vue b/proyek-frontend/app/components/templates/wedding/MusicPlayer.vue similarity index 100% rename from proyek-frontend/app/components/shared/MusicPlayer.vue rename to proyek-frontend/app/components/templates/wedding/MusicPlayer.vue diff --git a/proyek-frontend/app/components/shared/RSVP.vue b/proyek-frontend/app/components/templates/wedding/RSVP.vue similarity index 100% rename from proyek-frontend/app/components/shared/RSVP.vue rename to proyek-frontend/app/components/templates/wedding/RSVP.vue diff --git a/proyek-frontend/app/components/templates/wedding/WeddingA.vue b/proyek-frontend/app/components/templates/wedding/WeddingA.vue index 8031e2d..b3f4c9e 100644 --- a/proyek-frontend/app/components/templates/wedding/WeddingA.vue +++ b/proyek-frontend/app/components/templates/wedding/WeddingA.vue @@ -8,8 +8,9 @@

The Wedding of

- {{ data.bride.nickname }} & {{ data.groom.nickname }} + {{ data.bride?.nickname || 'Bride' }} & {{ data.groom?.nickname || 'Groom' }}

+

{{ formatDate(data.eventDate) }}

- - + +

πŸ–ΌοΈ Galeri Foto

@@ -178,14 +187,6 @@
- -
-

🎡 Musik

- -
diff --git a/proyek-frontend/app/pages/form/undangan-khitan-starter.vue b/proyek-frontend/app/pages/form/undangan-khitan-starter.vue new file mode 100644 index 0000000..74e57eb --- /dev/null +++ b/proyek-frontend/app/pages/form/undangan-khitan-starter.vue @@ -0,0 +1,257 @@ + + + diff --git a/proyek-frontend/app/pages/form/undangan-pernikahan-basic.vue b/proyek-frontend/app/pages/form/undangan-pernikahan-basic.vue new file mode 100644 index 0000000..d0d6580 --- /dev/null +++ b/proyek-frontend/app/pages/form/undangan-pernikahan-basic.vue @@ -0,0 +1,381 @@ +```vue + + + +``` \ No newline at end of file diff --git a/proyek-frontend/app/pages/form/undangan-pernikahan-starter.vue b/proyek-frontend/app/pages/form/undangan-pernikahan-starter.vue new file mode 100644 index 0000000..3969e59 --- /dev/null +++ b/proyek-frontend/app/pages/form/undangan-pernikahan-starter.vue @@ -0,0 +1,290 @@ + + + \ No newline at end of file diff --git a/proyek-frontend/app/pages/form/undangan-ulang-tahun-basic.vue b/proyek-frontend/app/pages/form/undangan-ulang-tahun-basic.vue new file mode 100644 index 0000000..55f6d39 --- /dev/null +++ b/proyek-frontend/app/pages/form/undangan-ulang-tahun-basic.vue @@ -0,0 +1,252 @@ + + + \ No newline at end of file diff --git a/proyek-frontend/app/pages/form/undangan-ulang-tahun-premium.vue b/proyek-frontend/app/pages/form/undangan-ulang-tahun-premium.vue index 7cd94c9..345a659 100644 --- a/proyek-frontend/app/pages/form/undangan-ulang-tahun-premium.vue +++ b/proyek-frontend/app/pages/form/undangan-ulang-tahun-premium.vue @@ -1,434 +1,174 @@ + }, + foto: [] +}) - \ No newline at end of file + +const removeFile = (index) => { + form.value.foto.splice(index, 1) + previews.value.splice(index, 1) +} + +const konfirmasi = async () => { + try { + // Basic client-side validation + if (!form.value.nama_pemesan || !form.value.email) { + alert('Harap isi kolom wajib (Nama Pemesan, Email)!') + return + } + + const data = new FormData() + data.append('nama_pemesan', form.value.nama_pemesan) + data.append('email', form.value.email) + data.append('no_tlpn', form.value.no_tlpn) + data.append('template_slug', 'undangan-ulang-tahun-premium') + + // Append form fields individually to ensure Laravel receives them as an array + for (const [key, value] of Object.entries(form.value.form)) { + data.append(`form[${key}]`, value) + } + + form.value.foto.forEach((file, index) => { + data.append(`foto[${index}]`, file) + }) + + console.log([...data]) // untuk debugging + + const res = await fetch('http://localhost:8000/api/pelanggans', { + method: 'POST', + body: data + }) + + const result = await res.json() + + if (!res.ok) { + if (res.status === 422) { + const errors = result.errors || {} + const errorMessages = Object.values(errors).flat().join('\n') + throw new Error(errorMessages || result.message || 'Validasi gagal') + } + if (res.status === 404) { + throw new Error(result.message || 'Template tidak ditemukan') + } + throw new Error(result.message || 'Gagal mengirim data') + } + + alert(result.message || 'Data berhasil disimpan!') + router.push('/') + } catch (err) { + console.error(err) + alert('Terjadi kesalahan: ' + err.message) + } +} + +const batal = () => router.back() + \ No newline at end of file diff --git a/proyek-frontend/app/pages/form/undangan-ulang-tahun-starter.vue b/proyek-frontend/app/pages/form/undangan-ulang-tahun-starter.vue new file mode 100644 index 0000000..38164ab --- /dev/null +++ b/proyek-frontend/app/pages/form/undangan-ulang-tahun-starter.vue @@ -0,0 +1,221 @@ + + + \ No newline at end of file diff --git a/proyek-frontend/app/pages/p/[code].vue b/proyek-frontend/app/pages/p/[code].vue index 2a93276..aaa4efb 100644 --- a/proyek-frontend/app/pages/p/[code].vue +++ b/proyek-frontend/app/pages/p/[code].vue @@ -1,5 +1,7 @@