Skip to content

Commit

Permalink
Merge pull request #278 from maykinmedia/feature/215-remove-startdatu…
Browse files Browse the repository at this point in the history
…m-filter

[#215] Removed startdatum filter
  • Loading branch information
SilviaAmAm authored Jan 18, 2022
2 parents 10df659 + ae9ec98 commit 36aedac
Showing 1 changed file with 1 addition and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ function getSearchZakenUrl(path, filters, currentDate) {
};
if (filters.zaaktypen.length) queryParams['zaaktype__in'] = filters.zaaktypen;
if (filters.bronorganisaties.length) queryParams['bronorganisatie__in'] = filters.bronorganisaties;
if (filters.startdatum) queryParams['startdatum__gte'] = filters.startdatum;

const urlSearchParams = new URLSearchParams(queryParams);

Expand All @@ -33,11 +32,9 @@ const DestructionForm = ({ zaaktypen, reviewers, zakenUrl, url, currentDate, csr

//filters
const [selectedZaaktypen, setSelectedZaaktypen] = useState([]);
const [selectedStartdatum, setSelectedStartdatum] = useState(null);
const [selectedBronorganisatie, setSelectedBronorganisatie] = useState([]);
const filters = {
zaaktypen: selectedZaaktypen,
startdatum: selectedStartdatum,
bronorganisaties: selectedBronorganisatie,
};

Expand Down Expand Up @@ -85,7 +82,7 @@ const DestructionForm = ({ zaaktypen, reviewers, zakenUrl, url, currentDate, csr
setError(error);
}
);
}, [selectedZaaktypen, selectedStartdatum, selectedBronorganisatie]);
}, [selectedZaaktypen, selectedBronorganisatie]);

const bronorganisatieCheckboxes = bronorganisaties.map((bronorganisatie, index) => {
return (
Expand Down Expand Up @@ -140,21 +137,6 @@ const DestructionForm = ({ zaaktypen, reviewers, zakenUrl, url, currentDate, csr
<label htmlFor={"id_bronorganisaties"}>Bronorganisatie</label>
{bronorganisatieCheckboxes}
</div>
<div className="filter-group__item">
<label htmlFor={"id_startdatum"}>Startdatum</label>
<DateInput
name={"startdatum"}
id={"id_startdatum"}
onBlur={(e) => {
const eventStartdatum = e.target.value;
if (eventStartdatum !== selectedStartdatum ) {
setIsLoaded(false);
setSelectedStartdatum(eventStartdatum);
}
}}
/>
</div>

</aside>

<section className="destruction-create__zaken">
Expand Down

0 comments on commit 36aedac

Please sign in to comment.