Brands properly formatted
This commit is contained in:
@@ -6,6 +6,16 @@ public struct Product: Codable, Sendable, Identifiable {
|
||||
public let productName: String?
|
||||
public let genericName: String?
|
||||
public let brands: String?
|
||||
|
||||
public var _brands: [String]? {
|
||||
guard let brands = brands else {
|
||||
return nil
|
||||
}
|
||||
return brands.split(separator: ",").map {
|
||||
$0.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
}
|
||||
}
|
||||
|
||||
public let brandsTags: [String]?
|
||||
public let quantity: String?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user