|
|
@ -401,22 +401,26 @@ export function useViewFilters( |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (linkColId?.value) { |
|
|
|
if (linkColId?.value) { |
|
|
|
// set value with current value of filter since user can change value while saving
|
|
|
|
const savedFilter = await $api.dbTableLinkFilter.create(linkColId.value, { |
|
|
|
filters.value[i] = { |
|
|
|
|
|
|
|
...((await $api.dbTableLinkFilter.create(linkColId.value, { |
|
|
|
|
|
|
|
...filter, |
|
|
|
...filter, |
|
|
|
fk_parent_id: parentId, |
|
|
|
fk_parent_id: parentId, |
|
|
|
})) || {}), |
|
|
|
}) |
|
|
|
value: (filters.value[i] || filter).value, |
|
|
|
// override any local changes with saved filter since user can change value while saving
|
|
|
|
|
|
|
|
filters.value[i] = { |
|
|
|
|
|
|
|
...(savedFilter || {}), |
|
|
|
|
|
|
|
...filters.value[i], |
|
|
|
|
|
|
|
status: undefined, |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// set value with current value of filter since user can change value while saving
|
|
|
|
const savedFilter = await $api.dbTableFilter.create(view.value.id!, { |
|
|
|
filters.value[i] = { |
|
|
|
|
|
|
|
...((await $api.dbTableFilter.create(view.value.id!, { |
|
|
|
|
|
|
|
...filter, |
|
|
|
...filter, |
|
|
|
fk_parent_id: parentId.value, |
|
|
|
fk_parent_id: parentId.value, |
|
|
|
})) || {}), |
|
|
|
}) |
|
|
|
value: (filters.value[i] || filter).value, |
|
|
|
// override any local changes with saved filter since user can change value while saving
|
|
|
|
|
|
|
|
filters.value[i] = { |
|
|
|
|
|
|
|
...(savedFilter || {}), |
|
|
|
|
|
|
|
...filters.value[i], |
|
|
|
|
|
|
|
status: undefined, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (!isLink && !isWebhook) allFilters.value.push(filters.value[+i]) |
|
|
|
if (!isLink && !isWebhook) allFilters.value.push(filters.value[+i]) |
|
|
|