-
-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add total contribution counts #552
Labels
Comments
1 task
M123-dev
changed the title
Add total contribution counts
Grace Hopper - Add total contribution counts
Sep 8, 2022
That still doesn't solve the case where the user logged in with an email instead of a user name :( |
Fyk @monsieurtanuki just created #7361 |
teolemon
changed the title
Grace Hopper - Add total contribution counts
Add total contribution counts
Sep 28, 2022
Actually we don't need an additional method; we can already get the count: /// Returns the number of contributions of a [type] by a [userId].
Future<int?> _getMyCount(
final String userId,
final UserProductSearchType type,
final OpenFoodFactsLanguage language,
) async {
final UserProductSearchQueryConfiguration configuration =
UserProductSearchQueryConfiguration(
type: type,
userId: userId,
pageSize: 1,
language: language,
fields: [],
);
final SearchResult result;
try {
result = await OpenFoodAPIClient.searchProducts(
OpenFoodAPIConfiguration.globalUser,
configuration,
queryType: OpenFoodAPIConfiguration.globalQueryType,
);
} catch (e) {
return null;
}
return result.count;
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What
The text was updated successfully, but these errors were encountered: