upload method
- LocalDatabase localDatabase
override
Uploads data changes.
Implementation
@override
Future<void> upload(LocalDatabase localDatabase) async {
final InsightAnnotation? annotation = InsightAnnotation.fromInt(
insightAnnotation,
);
if (annotation == null) {
// very unlikely
return;
}
await RobotoffAPIClient.postInsightAnnotation(
insightId.isEmpty ? null : insightId,
annotation,
deviceId: OpenFoodAPIConfiguration.uuid,
user: ProductQuery.getReadUser(),
uriHelper: ProductQuery.uriRobotoffHelper,
);
}