Comments (10)
We created that when we didn't have efficient editing, and also for offline editing (where tags on server might - 5% chance - have changed). It's more of a safety measure than anything else, but if you retrieve existing values, show them to the user, let them edit them, and send everything, we do not need them (assuming that the last user who speaks is right)
from openfoodfacts-dart.
It might be useful for other apps, but I'd rather have destructive editing for Smoothie (the whole point of the tag picker)
from openfoodfacts-dart.
@teolemon I guess once this implemented I should rollback my changes here ? #128
Otherwise writing labels, categories with saveProduct() will delete the previous values and keep only the last input
from openfoodfacts-dart.
@MohamedFBoussaid What's the current behavior ? We could have both ways, a full replace or a patch solution ?
add_ has some limitations as well (it does not allow for precision editing)
from openfoodfacts-dart.
I suggest a new method like this one:
static Future<Status> OpenFoodAPIClient.addToProduct(
User user,
Product product,
Map<AddableField, String> addedValues, {
QueryType queryType = QueryType.PROD,
})
with AddableField
being an enum
(BRANDS
, LABELS
, CATEGORIES
, ...)
That would have no impact on @MohamedFBoussaid's code.
@teolemon Would that suit your needs?
from openfoodfacts-dart.
@teolemon Would that suit your needs?
I think it would. I think editing the product is the main behavior we want to keep as a default here. @teolemon any thoughts?
from openfoodfacts-dart.
Yeah lets do it like that
from openfoodfacts-dart.
@VaiTon Any idea about the list of addable fields? Will they all be accepting String
as value?
from openfoodfacts-dart.
@VaiTon Any idea about the list of addable fields? Will they all be accepting
String
as value?
I think every field has an 'add' version except from code and lang. (From here https://wiki.openfoodfacts.org/API/Write)
Yes, everything can be sent as a string.
On android we have atm:
const val ADD_BRANDS = "add_brands"
const val ADD_PURCHASE = "add_purchase_places"
const val ADD_STORES = "add_stores"
const val ADD_COUNTRIES = "add_countries"
const val ADD_TRACES = "add_traces"
from openfoodfacts-dart.
@teolemon The way I understand your comment, you mean that this issue is pointless, should be closed and that the related PR should be ignored, am I right?
from openfoodfacts-dart.
Related Issues (20)
- pub.dev score back to 130 instead of 140 :( HOT 1
- Use new taxonomy suggestions biasing system
- start_offset request HOT 4
- Create MatchedScoreV2 and deprecate MatchedProductV2
- Different user agent for tests
- Add support for the weigh facet HOT 1
- User should be optional in get random robotoff questions HOT 1
- Robotoff refactoring HOT 7
- Refactor: get rid of path.dart dependency
- Autosuggest works erratically if the responses are not received in the right order HOT 5
- Add capacity to know which fields are producer provided HOT 1
- Add the ability to remove a translation in a multilingual field
- Refactoring from smoothie (KP element)
- Make the link between raw data and computed data visible
- Update HTTP Library HOT 7
- Implement Robotoff nutrition prediction route HOT 2
- Allow to fetch robotoff questions by insight_type for a given product HOT 3
- Match the latest Robotoff question and insight API HOT 1
- Robotoff: add the "server type" parameter (off, obf, ...) HOT 5
- Implement the new account deletion undocumented API HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openfoodfacts-dart.