fix: not all provinces data loaded in AreaSelectors#34
Merged
fityannugroho merged 4 commits intomainfrom Nov 3, 2024
Merged
Conversation
- Add `objectFromEntries` utility function
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
AreaSelectors
AreaSelectorsAreaSelectors
Build fails without it, but linter not complains (idk why, maybe because of different TS or Node version)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
This pull request introduces a new utility function and refactors the
AreaSelectorscomponent to improve code readability and maintainability. The most important changes include adding theobjectFromEntriesfunction and refactoring thequerystate initialization inAreaSelectors.New Utility Function:
lib/utils.ts: Added theobjectFromEntriesfunction to convert an array of key-value pairs into an object. ([lib/utils.tsR15-R20](https://github.com/fityannugroho/idn-area-map/pull/34/files#diff-98e56006aa8453a29bc2b8bc8e6f718b3f17ba66470f3a52a5dc5bd643482e70R15-R20))Refactoring:
modules/MapDashboard/AreaSelectors.tsx: Updated imports to include the newobjectFromEntriesfunction. ([modules/MapDashboard/AreaSelectors.tsxL5-R10](https://github.com/fityannugroho/idn-area-map/pull/34/files#diff-5b6caf9b06377fde132cc68d7700b2054f6f92ff966f11d60be387521e2b3babL5-R10))modules/MapDashboard/AreaSelectors.tsx: Refactored the initialization of thequerystate to use the newobjectFromEntriesfunction, improving readability and reducing redundancy. ([modules/MapDashboard/AreaSelectors.tsxR29-R53](https://github.com/fityannugroho/idn-area-map/pull/34/files#diff-5b6caf9b06377fde132cc68d7700b2054f6f92ff966f11d60be387521e2b3babR29-R53))Other information
None