|
|
@ -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, { |
|
|
|
|
|
|
|
...filter, |
|
|
|
|
|
|
|
fk_parent_id: parentId, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
// override any local changes with saved filter since user can change value while saving
|
|
|
|
filters.value[i] = { |
|
|
|
filters.value[i] = { |
|
|
|
...((await $api.dbTableLinkFilter.create(linkColId.value, { |
|
|
|
...(savedFilter || {}), |
|
|
|
...filter, |
|
|
|
...filters.value[i], |
|
|
|
fk_parent_id: parentId, |
|
|
|
status: undefined, |
|
|
|
})) || {}), |
|
|
|
|
|
|
|
value: (filters.value[i] || filter).value, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} 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!, { |
|
|
|
|
|
|
|
...filter, |
|
|
|
|
|
|
|
fk_parent_id: parentId.value, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
// override any local changes with saved filter since user can change value while saving
|
|
|
|
filters.value[i] = { |
|
|
|
filters.value[i] = { |
|
|
|
...((await $api.dbTableFilter.create(view.value.id!, { |
|
|
|
...(savedFilter || {}), |
|
|
|
...filter, |
|
|
|
...filters.value[i], |
|
|
|
fk_parent_id: parentId.value, |
|
|
|
status: undefined, |
|
|
|
})) || {}), |
|
|
|
|
|
|
|
value: (filters.value[i] || filter).value, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (!isLink && !isWebhook) allFilters.value.push(filters.value[+i]) |
|
|
|
if (!isLink && !isWebhook) allFilters.value.push(filters.value[+i]) |
|
|
|