-
-
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
feat: #306 - unselect product image #319
feat: #306 - unselect product image #319
Conversation
Impacted files: * `api_addProductImage_test.dart`: new test about "unselect product image" * `openfoodfacts.dart`: new method `unselectProductImage` * `ProductImage.dart`: minor unrelated refactoring
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @monsieurtanuki, looks good
lib/openfoodfacts.dart
Outdated
final Response response = await HttpHelper() | ||
.doGetRequest(uri, userAgent: OpenFoodAPIConfiguration.userAgent); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a comma after the user agent it is probably a bit more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I've just committed a refactoring.
It made me realize that it would probably be better to systematically include a User user
parameter to methods where we impact the server database (not just read it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@M123-dev I have added a mandatory User user
parameter in my recent setProductImageAngle
and setProductImageCrop
methods: does that qualify for a breaking change and the corresponding version upgrade? That would be a bit too generous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I don't think we need a breaking change here, the methods are only public for a few days anyway. And besides, I think it's more for when we make deprecate some things. So for things where the "code" breaks when upgrading. Even though the dart @deprecated doesn't actually make that so important.
Impacted files: * `api_addProductImage_test.dart`: added `User user` parameters when needed * `openfoodfacts.dart`: added `User user` parameter to WRITE methods; added ending commas
Impacted files:
api_addProductImage_test.dart
: new test about "unselect product image"openfoodfacts.dart
: new methodunselectProductImage
ProductImage.dart
: minor unrelated refactoring