Avoid unnecessary fetch for obtaining dictionaries #880
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.
The contents are linked to dictionaries such as cities, different types of categories, etc.
The application needs to get all elements at once whatever the count of items.
To do this, it fetches the first page of the list and retrieves the total count of items with the result.
If there are no others pages, it returns this result.
If not, it parallelizes the fetch of all pages to return the new result.
This PR concerns the "if not" part and avoids to re-fetch the first page, and concatenate its result with the news ones.