Add even more filters #77
Reference in New Issue
Block a user
Delete Branch "add-even-more-filters"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Changed helpers>db>realEstates.js and searchRequest.js to include more filters (as prepared from crawler and frontend part).
added 5 commits
master73b3f0d2- Merge branch 'master' into 'add-even-more-filters'Compare with previous version
added 1 commit
76f4ed0a- apply prettierCompare with previous version
This "if" condition block can be replaced like this (and you can omit "await") :
real estates will not have value "ANY" for "accessRoadType" (you can find values like "MACADAM", "ASPHALT",..., or NULL value, so this condition will not work. You can remove "accessRoadType" filter from query in this place and check comment below (where other attributes are checked) for suggestion how to add this filter
Same comment as for "query"
Here you can check if "accessRoadType" variable is "ANY". If it is, you can ommit "accessRoadType" from query, so it will fetch all road types (even with null values).
If "accessRoadType" is different from "ANY", just add filter for this value (add to the query object).
Also don't forget "queryIncludeIncomplete" object (if you add filter for "accessRoadType" to the query object, also add to the queryIncludeIncomplete)
I understood. I ll try to remember to use ternary for next time.
I changed this (prettier, ternary op and accesRoadType mistake). Should I commit change or wait for more comments-corrections? I don't know what is recommended policy :)
changed this line in version 4 of the diff
changed this line in version 4 of the diff
changed this line in version 4 of the diff
added 2 commits
c672b3ab- First review changes: applied prettier, ternary and changed accesRoadType filter4391aa59- First review changes: applied prettier, ternary and changed accesRoadType filterCompare with previous version
Now we have option for users to check if they want to get notified for real estates with some filters undefined, we need to update partial filters (area, gardenSize, numberOfRooms,... ) somehow.
Here is idea but we can discuss more on this :
Let's consider
areabut this should be reflected on all other partial filters.Here we have one new real estate with property
areaand we can have two cases :areais null (not defined in real estate ad)areais not null (and is numerical value)If (1) is TRUE, we should get only those search requests that are interested in real estates with incomplete information.
Else, (2) is TRUE and we can keep current filter to get matching search requests for this real estate.
From this, I would say we can keep current partial filters and then add on the end :
NOTE : not all partial filters should be included in if condition for all real estate types. For example, if real estate type is LAND, adding
!numberOfRoomscondition would filter all LAND search requests whereincludeIncompleteAdsis FALSE.It may sound confusing, so please comment or ask if something is unclear or you have a better approach for this problem :)
added 1 commit
251437f8- Changed searchRequest to include case of incomplete ads wanted.Compare with previous version
I think I understood what is problem with Include Incomplete Ads option. I changed enums.js to include information about which filter should be included based on real estate type. I also changed searchRequest.js in accordance to comments above to consider case that user wants to see incomplete ads (new commit). If I missed something let me know :)
Great, nice work 👍
we can discuss should we apply this logic on price also or not
You can remove else case for price condition, so that we get real estates with or without price
you can copy price filter from
queryIncludeIncompleteto include also real estates without pricechanged this line in version 6 of the diff
changed this line in version 6 of the diff
added 1 commit
bee390aa- RealEstate included even is price is null.Compare with previous version
Done, now commit!
Also done, new commit!
resolved all threads
changed this line in version 7 of the diff
changed this line in version 7 of the diff
added 1 commit
42ff1f76- Changed to avoid falsy values and not defined realestate parametrs.Compare with previous version
added 1 commit
d5d3a1f3- Changed accesRoadType logicCompare with previous version
added 11 commits
master4fd4018b- Merge branch 'sliders-formating' of gitlab.com:saburly/marketalarm/web into add-even-more-filters870b71a3- WIP Changed all logic for searchRequest.Compare with previous version
marked as a Work In Progress from
870b71a3c7added 1 commit
d1173838- Tested both ways for realestate and search req filters.Compare with previous version
unmarked as a Work In Progress
merged
mentioned in commit
4a6bcf262e