I think I’ve finished merging Yuxin’s filter queries. I pulled from Barney's branch earlier, and worked with that. I wouldn’t be surprised if there are some changes I need to make. Please let me know if you notice anything weird or messy that I've introduced.
@tyxxxx , I changed the implementation a bit so that I could display the loading spinner and error messages and also switch between filtered and unfiltered posts. I removed the state in App.js that stored the filtered posts and moved it into PostCollection. Instead of having a separate hook in each filter component and then copying all of the results over, I changed it to just pass the query url and then used one hook in PostCollection to execute all of the filter queries. It makes the code a lot shorter and it lets me set the isLoading and displayErrors states for the queries. I also removed the occasional commented out block of code and console.log statement. Hope that’s okay.
@tyxxxx I also found some more changes that would be helpful for you to make if possible.
There’s a bug with the location queries. On my machine at least, the location queries seem to only return with a 500 server error. Can you look into this please? I tested this before merging, so I think the bug must be in the index.js file in the backend.
Line 49 in UserList causes an error in the console.
I noticed some css in the userLists component. I think it would be best to move this into a separate file. (I think the instructors recommended this at the start of term, and it’s also just good to keep the code consistent).
For the price range, we should implement some logic to make sure that the low price can’t exceed the high price and vice versa.
Hi all,
I think I’ve finished merging Yuxin’s filter queries. I pulled from Barney's branch earlier, and worked with that. I wouldn’t be surprised if there are some changes I need to make. Please let me know if you notice anything weird or messy that I've introduced.
@tyxxxx , I changed the implementation a bit so that I could display the loading spinner and error messages and also switch between filtered and unfiltered posts. I removed the state in App.js that stored the filtered posts and moved it into PostCollection. Instead of having a separate hook in each filter component and then copying all of the results over, I changed it to just pass the query url and then used one hook in PostCollection to execute all of the filter queries. It makes the code a lot shorter and it lets me set the isLoading and displayErrors states for the queries. I also removed the occasional commented out block of code and console.log statement. Hope that’s okay.
@tyxxxx I also found some more changes that would be helpful for you to make if possible.
There’s a bug with the location queries. On my machine at least, the location queries seem to only return with a 500 server error. Can you look into this please? I tested this before merging, so I think the bug must be in the index.js file in the backend.
Line 49 in UserList causes an error in the console.
I noticed some css in the userLists component. I think it would be best to move this into a separate file. (I think the instructors recommended this at the start of term, and it’s also just good to keep the code consistent).
For the price range, we should implement some logic to make sure that the low price can’t exceed the high price and vice versa.
Thanks, Naithan