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

@@ -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