From b82db9e69f3426ec1e86ff69eed67bf85a1a40b4 Mon Sep 17 00:00:00 2001 From: Benjamin Petetot Date: Sun, 1 Nov 2020 16:41:52 +0100 Subject: [PATCH] :bug: fix proposals export --- src/store/reactions/proposals.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/store/reactions/proposals.js b/src/store/reactions/proposals.js index cdd835794..d8249a5ea 100644 --- a/src/store/reactions/proposals.js +++ b/src/store/reactions/proposals.js @@ -1,4 +1,6 @@ import firebase from 'firebase/app' +import omitBy from 'lodash/omitBy' +import isNil from 'lodash/isNil' import { downloadFile } from 'helpers/dom' import * as firebaseProposals from 'firebase/proposals' @@ -33,9 +35,8 @@ export const exportProposals = async (action, store) => { const token = await firebase.auth().currentUser.getIdToken() - // get proposal filters & sort from query params const query = encodeURI( - Object.entries({ ...filters, output }) + Object.entries({ ...omitBy(filters, isNil), output }) .map(([key, value]) => `${key}=${value}`) .join('&'), )