😑 using search-a-licious API now...
This commit is contained in:
@@ -35,10 +35,10 @@ public struct NutriscoreData: Sendable, Codable {
|
||||
|
||||
isBeverage = try container.decodeIfPresent(
|
||||
Int.self, forKey: .isBeverage)
|
||||
isCheese = try container.decodeStringOrInt(forKey: .isCheese)
|
||||
isWater = try container.decodeStringOrInt(forKey: .isWater)
|
||||
isFat = try container.decodeStringOrInt(forKey: .isFat)
|
||||
energy = try container.decodeStringOrInt(forKey: .energy)
|
||||
isCheese = try container.decodeIntOrString(forKey: .isCheese)
|
||||
isWater = try container.decodeIntOrString(forKey: .isWater)
|
||||
isFat = try container.decodeIntOrString(forKey: .isFat)
|
||||
energy = try container.decodeIntOrString(forKey: .energy)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ public struct Product: Codable, Sendable, Identifiable {
|
||||
String.self, forKey: .productName)
|
||||
genericName = try container.decodeIfPresent(
|
||||
String.self, forKey: .genericName)
|
||||
brands = try container.decodeIfPresent(String.self, forKey: .brands)
|
||||
brands = try container.decodeStringOrArray(forKey: .brands)
|
||||
brandsTags = try container.decodeIfPresent(
|
||||
[String].self, forKey: .brandsTags)
|
||||
quantity = try container.decodeIfPresent(String.self, forKey: .quantity)
|
||||
|
||||
@@ -2,10 +2,10 @@ import Foundation
|
||||
|
||||
public enum SearchParameter: Sendable, Hashable {
|
||||
case query(String)
|
||||
case tag(tag: SearchTagType, value: String)
|
||||
// case tag(tag: SearchTagType, value: String)
|
||||
case page(Int)
|
||||
case pageSize(Int)
|
||||
case sort(SearchSort)
|
||||
// case sort(SearchSort)
|
||||
}
|
||||
|
||||
public enum SearchTagType: String, Sendable {
|
||||
|
||||
Reference in New Issue
Block a user