From d32ba2baa97ad89612180591b3bf7ecef13ac33a Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sun, 27 Oct 2019 05:31:23 +0000 Subject: [PATCH] minor changes on server --- models/found.js | 4 ++-- routes/index.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) 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,