Fix: Filters not always being reset. #13
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #7 .
From what I understand, the code doesn't clear all the filter because the code tries to loop a
router.push()
which I don't think it's working and thus from what I observe, it only deletes the last filter search params.What I did is instead of loop
router.push()
, first I collect all of the params, second then remove all the null params, then finally create acreateQueryString
based on the net params then push to the new URL. I also left a comment on my changes that describes this.I'm really sorry I can't create an exact deployment example of this repo because this repo uses Planet Scale with Drizzle ORM. Last time I used Planet Scale I can create new projects without credit cards, but now it forces me use credit card. So I can't create a Planet Scale project.
But I have created a project implementing SSR table without the search input filter, but a plus with a Date Range Picker. My project link https://astro.dewodt.com or github https://github.com/dewodt/guess-astro (I use Neon Posgres for this project). Particularly, the feature is implemented in the
/history
page. But it requires sign in, so I'm just going to show you a recording of it. Here's the video demo:shadcn-table-demo.mp4
Please review my code. Thank you.
@sadmann7 @kavinvalli