diff --git a/models/listing.js b/models/listing.js index cc11890a..6b864903 100644 --- a/models/listing.js +++ b/models/listing.js @@ -8,13 +8,8 @@ const listingSchema = new Schema({ }, description: String, image: { - type: String, - default: - "https://images.unsplash.com/photo-1625505826533-5c80aca7d157?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MTJ8fGdvYXxlbnwwfHwwfHx8MA%3D%3D&auto=format&fit=crop&w=800&q=60", - set: (v) => - v === "" - ? "https://images.unsplash.com/photo-1625505826533-5c80aca7d157?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MTJ8fGdvYXxlbnwwfHwwfHx8MA%3D%3D&auto=format&fit=crop&w=800&q=60" - : v, + filename: String, // You can store the filename as a string + url: String // You can store the URL as a string }, price: Number, location: String,