fix: errors
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user