From 5a5de81bec8f18ae0f27d528d862e6cf1438b54a Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Sun, 24 Aug 2025 17:51:06 +0100 Subject: Add dialog for conference deletion --- web/pages/conferences.vue | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) (limited to 'web/pages/conferences.vue') diff --git a/web/pages/conferences.vue b/web/pages/conferences.vue index 993bc66..511de95 100644 --- a/web/pages/conferences.vue +++ b/web/pages/conferences.vue @@ -24,6 +24,12 @@ const config = useRuntimeConfig(); const status = ref('idle' as 'loading' | 'idle') +const refConfirmDeleteDialog = ref(); + +const deleteConferenceId = ref(null as number | null) +const deleteConferenceName = ref(null as string | null) +const deleteAction = ref(false); + const fetchConferences = () => { status.value = 'loading' $api(config.public.baseURL + '/conference', { @@ -42,22 +48,22 @@ const fetchConferences = () => { }) } -const deleteConference = (id: number) => { - // todo make this better +const deleteConference = () => { $api(config.public.baseURL + '/conference', { method: 'DELETE', body: { - id: id + id: deleteConferenceId.value }, onResponse: ({ response }) => { if (!response.ok) { errorStore.setError(response._data.message || 'An unknown error occurred'); } + fetchConferences() }, }) } -const selectConference = async (c) => { +const selectConference = async (c: any) => { setting.value = true conferenceStore.id = c.id try { @@ -77,18 +83,22 @@ onMounted(fetchConferences) + + + Are you sure you want to delete "{{ deleteConferenceName }}"? + All favourites for all users for this conference will be lost and irrecoverable. + +