I wrote up a model for posts on a side project and I keep getting errors: "Type 'Post' does not conform to protocol 'Decodable'" "Type 'Post' does not conform to protocol 'Encodable'"
Please help
struct Post: Identifiable,Codable{
@DocumentID var id: String?
var text: String
var imageURL: URL?
var imageRefID: String = ""
var createdAt: Date = Date()
var likedIDs: [String] = []
var dislikedIDs: [String] = []
//Info about author of post
var username: String
var userUID: String
var userProfileURL: URL
enum CodingKeys: String, CodingKey {
case id
case text
case imageURL
case imageRefID
case createdAt
case likedIDs
case dislikedIDs
case usernanme
case userUID
case userProfileURL
}
}