diff --git a/apps/app/src/components/event/RegistrationFieldFormDialog.vue b/apps/app/src/components/event/RegistrationFieldFormDialog.vue index da62d8ea..23f1b563 100644 --- a/apps/app/src/components/event/RegistrationFieldFormDialog.vue +++ b/apps/app/src/components/event/RegistrationFieldFormDialog.vue @@ -323,46 +323,39 @@ defineExpose({ setErrors })
- -
- -
- - -
- -
-
+
+ + + + +
>() const snackbar = ref(false) const serverErrors = ref>({}) -const logoUrl = ref('') +const logoUrl = ref(null) const primaryColor = ref('#6366F1') const secondaryColor = ref('#4F46E5') const footerText = ref('') @@ -31,7 +31,7 @@ const showSecondaryPicker = ref(false) watch(settings, s => { if (s) { - logoUrl.value = s.logo_url ?? '' + logoUrl.value = s.logo_url ?? null primaryColor.value = s.primary_color ?? '#6366F1' secondaryColor.value = s.secondary_color ?? '#4F46E5' footerText.value = s.footer_text ?? '' diff --git a/apps/app/src/components/organisation/RegistrationFieldTemplatesTab.vue b/apps/app/src/components/organisation/RegistrationFieldTemplatesTab.vue index d6b0d0f3..602e9896 100644 --- a/apps/app/src/components/organisation/RegistrationFieldTemplatesTab.vue +++ b/apps/app/src/components/organisation/RegistrationFieldTemplatesTab.vue @@ -562,46 +562,39 @@ function activate(template: RegistrationFieldTemplate) {
- -
- -
- - -
- -
-
+
+ + + + +
import { VForm } from 'vuetify/components/VForm' import EventTabsNav from '@/components/events/EventTabsNav.vue' -import { useUpdateEvent, useUploadEventImage } from '@/composables/api/useEvents' +import ImageUploadField from '@/components/common/ImageUploadField.vue' +import { useUpdateEvent } from '@/composables/api/useEvents' import { useAuthStore } from '@/stores/useAuthStore' import type { EventItem, UpdateEventPayload } from '@/types/event' @@ -24,16 +25,29 @@ const settingsTab = computed(() => { }) const { mutate: updateEvent, isPending: isUpdating } = useUpdateEvent(orgId, eventId) -const { mutate: uploadImage, isPending: isUploading } = useUploadEventImage(orgId, eventId) +const bannerUrl = ref(null) +const logoUrl = ref(null) const welcomeText = ref('') const showSuccess = ref(false) const refVForm = ref() function initForm(event: EventItem) { + bannerUrl.value = event.registration_banner_url ?? null + logoUrl.value = event.registration_logo_url ?? null welcomeText.value = event.registration_welcome_text ?? '' } +function onBannerChange(url: string | null) { + bannerUrl.value = url + updateEvent({ registration_banner_url: url } as UpdateEventPayload) +} + +function onLogoChange(url: string | null) { + logoUrl.value = url + updateEvent({ registration_logo_url: url } as UpdateEventPayload) +} + function onSaveWelcomeText() { updateEvent( { registration_welcome_text: welcomeText.value || null }, @@ -44,19 +58,6 @@ function onSaveWelcomeText() { }, ) } - -function onFileSelected(files: File[], type: 'banner' | 'logo') { - const file = files[0] - if (!file) return - - uploadImage({ file, type }) -} - -function onClearImage(event: EventItem, type: 'banner' | 'logo') { - const field = type === 'banner' ? 'registration_banner_url' : 'registration_logo_url' - - updateEvent({ [field]: null } as UpdateEventPayload) -}