diff --git a/models/found.js b/models/found.js index 1b117d2..f91377f 100644 --- a/models/found.js +++ b/models/found.js @@ -4,7 +4,7 @@ const foundSchema = mongoose.Schema({ _id : mongoose.Schema.Types.ObjectId, label: { type: String }, email: { type: String }, - timestamp: {type: Data, default: Date.now} + timestamp: {type: Date, default: Date.now} }); -module.exports = mongoose.model('Founds', foundSchema); \ No newline at end of file +module.exports = mongoose.model('Founds', foundSchema); diff --git a/routes/index.js b/routes/index.js index 79e69c0..004de1e 100644 --- a/routes/index.js +++ b/routes/index.js @@ -113,6 +113,7 @@ router.post('/uploadlost', upload.array("lostImage", 10), (req, res, next) => { }); router.post('/uploadfound', upload.array("foundImage", 10), (req, res, next) => { + console.log(req.body); if(req.files.size<=0 ) { res.status(500).json({ status: "fail" @@ -120,6 +121,7 @@ router.post('/uploadfound', upload.array("foundImage", 10), (req, res, next) => } else { const mongooseId = mongoose.Types.ObjectId(); const labelname = mongooseId; + console.log(req.body); const newfimage = new found({ _id: mongooseId, label: labelname,