New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix to Filter not being proprely handled when naviagating back to Home Page #1205
Conversation
These are insanely particular code checks . It can still be merged. |
6af0160
to
3980964
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty great! I fixed the linting errors and added some tests for the new utility file
if (f.crime && !isValidCrime(f.crime)) delete f.crime | ||
if (f.place && !lookupUsa(f.place, f.placeType)) delete f.place | ||
|
||
const f = filterValidator({ ...filters }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's combine this with the line below so that we don't have to declare the variable
@@ -1,15 +1,9 @@ | |||
import { FILTER_RESET, FILTERS_UPDATE } from './constants' | |||
import offenses from '../util/offenses' | |||
import lookupUsa from '../util/usa' | |||
import filterValidator from '../util/filter' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love pulling this out into a util
@@ -0,0 +1,63 @@ | |||
/* eslint no-undef: 0 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a test file for the new util, FYI
No description provided.