fix submit handler

This commit is contained in:
2025-06-18 16:00:20 +02:00
parent 78036f9aea
commit 62ddc33290
15 changed files with 73 additions and 45 deletions

View File

@ -1,5 +1,5 @@
<template>
<div class="p-2 h-full">
<div class="p-2 min-h-full">
<NuxtPage />
</div>
</template>

View File

@ -1,5 +1,6 @@
<template>
<div>
currentGroup{{ currentGroup }}
<HaexPassGroup
v-model="group"
mode="edit"
@ -26,8 +27,8 @@ const group = ref<SelectHaexPasswordsGroups>()
watch(
currentGroup,
(newGroup) => {
group.value = JSON.parse(JSON.stringify(newGroup))
() => {
group.value = JSON.parse(JSON.stringify(currentGroup.value))
},
{ immediate: true },
)
@ -43,7 +44,7 @@ const onClose = () => {
const { add } = useSnackbar()
const { updateAsync } = usePasswordGroupStore()
const { updateAsync, syncGroupItemsAsync } = usePasswordGroupStore()
const onSaveAsync = async () => {
try {
@ -53,7 +54,7 @@ const onSaveAsync = async () => {
if (errors.value.name.length || errors.value.description.length) return
await updateAsync(group.value)
syncGroupItemsAsync()
add({ type: 'success', text: t('change.success') })
onClose()
} catch (error) {

View File

@ -1,13 +1,12 @@
<template>
<div class="relative h-full">
<div class="h-full relative">
<div class="h-full">
<HaexPassGroupBreadcrumbs
:items="breadCrumbs"
class="px-2 z-10 bg-base-200"
v-show="breadCrumbs.length"
/>
<div class="h-full overflow-auto flex flex-col">
<HaexPassGroupBreadcrumbs
:items="breadCrumbs"
class="px-2"
v-show="breadCrumbs.length"
/>
<HaexPassMobileMenu
:menu-items="groupItems"
ref="listRef"

View File

@ -4,6 +4,7 @@
:history="item.history"
:read_only
@close="onClose"
@submit="onUpdateAsync"
v-model:details="item.details"
v-model:key-values-add="item.keyValuesAdd"
v-model:key-values-delete="item.keyValuesDelete"
@ -14,7 +15,7 @@
class="fixed bottom-4 flex justify-between transition-all pointer-events-none right-0 sm:items-center items-end"
:class="[isVisible ? 'left-15 ' : 'left-0']"
>
<div class="flex items-center justify-center w-full">
<div class="flex items-center justify-center flex-1">
<UiTooltip :tooltip="t('abort')">
<UiButton
class="btn-accent btn-square"
@ -71,7 +72,7 @@
</UiButton>
</UiTooltip>
<div class="flex items-center justify-center w-full">
<div class="flex items-center justify-center flex-1">
<UiTooltip :tooltip="t('delete')">
<UiButton
class="btn-square btn-error"

View File

@ -4,15 +4,16 @@
:default-icon="currentGroup?.icon"
:history="item.history"
@close="onClose"
@submit="onCreateAsync"
v-model:details="item.details"
v-model:key-values-add="item.keyValuesAdd"
/>
<div
class="fixed bottom-4 flex justify-between transition-all pointer-events-none right-15 sm:items-center items-end"
class="fixed bottom-4 flex justify-between transition-all pointer-events-none right-0 sm:items-center items-end"
:class="[isVisible ? 'left-15 ' : 'left-0']"
>
<div class="flex items-center justify-center w-full">
<div class="flex items-center justify-center flex-1">
<UiTooltip :tooltip="t('abort')">
<UiButton
class="btn-error btn-square"
@ -33,7 +34,7 @@
/>
</UiButton>
</UiTooltip>
<div class="flex items-center justify-center w-full"></div>
<div class="flex items-center justify-center flex-1"></div>
</div>
</div>
</template>