Skip to content
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

Merged
merged 2 commits into from Dec 15, 2021

Conversation

monsieurtanuki
Copy link
Contributor

Impacted files:

  • api_addProductImage_test.dart: new test about "unselect product image"
  • openfoodfacts.dart: new method unselectProductImage
  • ProductImage.dart: minor unrelated refactoring

Impacted files:
* `api_addProductImage_test.dart`: new test about "unselect product image"
* `openfoodfacts.dart`: new method `unselectProductImage`
* `ProductImage.dart`: minor unrelated refactoring
Copy link
Member

@M123-dev M123-dev left a 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

Comment on lines 1045 to 1046
final Response response = await HttpHelper()
.doGetRequest(uri, userAgent: OpenFoodAPIConfiguration.userAgent);
Copy link
Member

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.

Copy link
Contributor Author

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).

Copy link
Contributor Author

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.

Copy link
Member

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Server-side photo unselection
3 participants