Add FetchLocationsUseCase#2484
Merged
Merged
Conversation
2fea861 to
bcb1c3b
Compare
scottkicks
approved these changes
Jun 20, 2025
scottkicks
left a comment
Contributor
There was a problem hiding this comment.
Cool! I wonder if this could be adapted for the locations selector on the rewards screen.
Contributor
Author
Good idea! |
jovaniks
approved these changes
Jun 20, 2025
jovaniks
left a comment
Contributor
There was a problem hiding this comment.
Love this new usecase ❤️. Just a couple of suggestion, not blockers!
| } else { | ||
| nil | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
Just a minor suggestion, not a big deal at all. This version might look a bit cleaner/fancier from my perspective:
return nodes.compactMap { node in
guard let fragment = node?.fragments.locationFragment else { return nil }
return KsApi.Location.location(from: fragment)
}
Contributor
Author
There was a problem hiding this comment.
Yeah, I like that better too! Will fix.
| nil | ||
| } | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
Same thing here, but again - just my inclination/preference
| } | ||
|
|
||
| /// A use case for fetching locations for the purpose of filtering projects. | ||
| public final class FetchLocationsUseCase: FetchLocationsUseCaseType, FetchLocationsUseCaseInputs, |
Contributor
There was a problem hiding this comment.
Love this FetchLocationsUseCase
This is a small use case for getting default and suggested locations. It will be used by SearchFiltersUseCase.
bcb1c3b to
e0a6fb0
Compare
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.
📲 What
Add
FetchLocationsUseCase.This is a small use case for getting default and suggested locations from the server. It will be used by
SearchFiltersUseCase.🤔 Why
Pulling this behavior out into its own use case makes it easy to test these network calls, and easier to test and hook up
SearchFiltersUseCase.