Fixed some bugs, but ambiguous types are there

This commit is contained in:
cdricms
2023-12-15 23:38:36 +01:00
parent 2f919ffdef
commit e699d71597
13 changed files with 294 additions and 233 deletions

View File

@@ -3,9 +3,11 @@ import OpenFoodFacts
let off = OpenFoodFactsClient()
do {
let res = try await off.getProductByBarcode("3017620422003")
print(res.product!.nutriments!.energy!)
} catch {
print("\(error)")
for barcode in ["0737628064502", "0812133010036", "0849092103196", "22007377", "3033610048398", "3222473161867", "3242272260059", "3245412470929", "3502110000880", "3551100749018", "3560070805259", "3560070976867", "3596710352418", "3800020430781", "4000539770708", "4388858946739", "5010251168577", "5015821151720", "5050854517631", "5054070608074", "5201051001076", "5410228196693", "5449000179661"] {
do {
try await off.getProductByBarcode(barcode)
// print(res.product!)
} catch {
print("[BARCODE: \(barcode)]\(error)")
}
}