Skip to content

Commit

Permalink
use omitBy
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro committed Mar 1, 2022
1 parent 74f8537 commit c02543b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions superset-frontend/src/explore/exploreUtils/formData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
import { omitBy } from 'lodash';
import { SupersetClient, JsonObject } from '@superset-ui/core';

type Payload = {
Expand All @@ -27,9 +28,7 @@ type Payload = {
const TEMPORARY_CONTROLS = new Set(['url_params']);

export const sanitizeFormData = (formData: JsonObject): JsonObject =>
Object.keys(formData)
.filter(key => !TEMPORARY_CONTROLS.has(key))
.reduce((cum, key) => ({ ...cum, [key]: formData[key] }), {});
omitBy(formData, key => TEMPORARY_CONTROLS.has(key));

const assembleEndpoint = (key?: string, tabId?: string) => {
let endpoint = 'api/v1/explore/form_data';
Expand Down

0 comments on commit c02543b

Please sign in to comment.