diff --git a/packages/react-redux/src/slices/cartoSlice.d.ts b/packages/react-redux/src/slices/cartoSlice.d.ts index 7db9a5632..97b3a6e97 100644 --- a/packages/react-redux/src/slices/cartoSlice.d.ts +++ b/packages/react-redux/src/slices/cartoSlice.d.ts @@ -50,7 +50,6 @@ declare enum CartoActions { SET_BASEMAP = 'carto/setBasemap', ADD_FILTER = 'carto/addFilter', REMOVE_FILTER = 'carto/removeFilter', - REMOVE_FILTER_BY_OWNER = 'carto/removeFilterByOwner', CLEAR_FILTERS = 'carto/clearFilters', SET_VIEWPORT_FEATURES = 'carto/setViewportFeatures', REMOVE_VIEWPORT_FEATURES = 'carto/removeViewportFeatures', @@ -116,13 +115,6 @@ export function removeFilter( payload: FilterCommonProps; }; -export function removeFilterByOwner( - arg: { id: string, owner: string } -): { - type: CartoActions.REMOVE_FILTER_BY_OWNER; - payload: { id: string, owner: string }; -}; - export function clearFilters( id: string ): { diff --git a/packages/react-redux/src/slices/cartoSlice.js b/packages/react-redux/src/slices/cartoSlice.js index da33cd7c2..11e425235 100644 --- a/packages/react-redux/src/slices/cartoSlice.js +++ b/packages/react-redux/src/slices/cartoSlice.js @@ -117,23 +117,6 @@ export const createCartoSlice = (initialState) => { delete source.filters[column]; } }, - removeFilterByOwner: (state, action) => { - const { id, owner } = action.payload; - const filtersToRemove = []; - - Object.entries(state.dataSources[id]?.filters || {}).forEach( - ([column, filter]) => { - Object.entries(filter || {}).forEach(([, type]) => { - if (type.owner === owner) { - filtersToRemove.push({ id, column }); - } - }); - } - ); - filtersToRemove.forEach((filter) => { - delete state?.dataSources[filter.id]?.filters[filter.column]; - }); - }, clearFilters: (state, action) => { const { id } = action.payload; const source = state.dataSources[id]; @@ -250,16 +233,6 @@ export const removeFilter = ({ id, column }) => ({ payload: { id, column } }); -/** - * Action to remove filter by widget owner - * @param {id} - sourceId of the filter to remove - * @param {owner} - widgetId of the filter to remove - */ -export const removeFilterByOwner = ({ id, owner }) => ({ - type: 'carto/removeFilterByOwner', - payload: { id, owner } -}); - /** * Action to remove all filters from a source * @param {id} - sourceId