Skip to content

Commit

Permalink
fix: avoid setting filters if a filters attachment already exists (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
MarconLP authored Jul 23, 2024
1 parent 591b5af commit b5ac066
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ export const pipelinePluginConfigurationLogic = kea<pipelinePluginConfigurationL
lemonToast.error('Data pipelines add-on is required for enabling new destinations.')
return values.pluginConfig
}
const { enabled, order, name, description, filters, ...config } = formdata
const { enabled, order, name, description, ...config } = formdata
const { filters } = formdata // This is to make sure the config object includes the filters field

const formData = getPluginConfigFormData(
values.plugin.config_schema,
Expand All @@ -160,7 +161,7 @@ export const pipelinePluginConfigurationLogic = kea<pipelinePluginConfigurationL
formData.append('description', description)

const sanitizedFilters = sanitizeFilters(filters)
if (filters) {
if (filters && !formData.has('add_attachment[filters]')) {
formData.append('filters', sanitizedFilters ? JSON.stringify(sanitizedFilters) : '')
}

Expand Down

0 comments on commit b5ac066

Please sign in to comment.