fix: errors

This commit is contained in:
2026-03-19 09:26:47 +01:00
parent 506c64e240
commit 43f856ee8d
5 changed files with 11 additions and 9 deletions

View File

@@ -1,5 +1,4 @@
<script setup lang="ts">
import ProductsView from '@/views/customer/ProductsView.vue';
import LangSwitch from './inner/langSwitch.vue'
import ThemeSwitch from './inner/themeSwitch.vue'
import { useAuthStore } from '@/stores/auth'

View File

@@ -134,7 +134,12 @@ function openCreateModal() {
}
function openEditModal(address: any) {
formData.value = { ...address }
formData.value = {
street: address.street,
zipCode: address.zipCode,
city: address.city,
country: address.country
}
isEditing.value = true
editingAddressId.value = address.id
showModal.value = true

View File

@@ -86,16 +86,18 @@ export const useAddressStore = defineStore('address', () => {
function updateAddress(id: number, formData: AddressFormData): boolean {
const index = addresses.value.findIndex(a => a.id === id)
if (index === -1) return false
if (index === -1) return false
const existing = addresses.value[index]
if (!existing) return false
addresses.value[index] = {
...addresses.value[index],
id: existing.id,
...normalize(formData)
}
return true
}
function deleteAddress(id: number): boolean {
const index = addresses.value.findIndex(a => a.id === id)
if (index === -1) return false

View File

@@ -15,8 +15,6 @@ import { useAuthStore } from '@/stores/auth'
import { i18n } from '@/plugins/02_i18n'
import type { TableColumn } from '@nuxt/ui'
import { useI18n } from 'vue-i18n'
import ProductDetailView from './customer/ProductDetailView.vue'
import ProductsView from './customer/ProductsView.vue'
ChartJS.register(Title, Tooltip, Legend, BarElement, CategoryScale, LinearScale)