From e389b57f01e7c5ffd7016222f2b41610a83d7b6d Mon Sep 17 00:00:00 2001 From: Ritesh1707 <134948727+Ritesh1707@users.noreply.github.com> Date: Sat, 23 Mar 2024 05:22:17 +0530 Subject: [PATCH] Update listing.js As per data, the schema defined is wrong I have updated the schema structure a bit. --- models/listing.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/models/listing.js b/models/listing.js index cc11890a..e9e88805 100644 --- a/models/listing.js +++ b/models/listing.js @@ -7,14 +7,9 @@ const listingSchema = new Schema({ required: true, }, 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, + image:{ + filename : {type:String}, + url : {type:String} }, price: Number, location: String,