From 36dd3d823895f6550786d908bb3cd8e282efb881 Mon Sep 17 00:00:00 2001 From: Jonasz Bigda Date: Fri, 18 Sep 2020 18:58:55 +0200 Subject: [PATCH] server v1.0.2 --- models/restaurant.js | 1 + routes/routeImg.js | 2 +- services/dataPrepServices.js | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/models/restaurant.js b/models/restaurant.js index f21c899..4d7bbf2 100644 --- a/models/restaurant.js +++ b/models/restaurant.js @@ -28,6 +28,7 @@ const restaurantSchema = mongoose.Schema({ required: true, }, }, + placesId: String, imgUrl: { type: String, }, diff --git a/routes/routeImg.js b/routes/routeImg.js index 5723900..4eebc60 100644 --- a/routes/routeImg.js +++ b/routes/routeImg.js @@ -15,7 +15,7 @@ const uploadStrategy = multer({ cb(null, true); }, limits: { fileSize: 4000000 }, -}).single("image"); +}).single("menuiImage"); // POST diff --git a/services/dataPrepServices.js b/services/dataPrepServices.js index 223c451..29311f8 100644 --- a/services/dataPrepServices.js +++ b/services/dataPrepServices.js @@ -57,6 +57,7 @@ export async function createRestaurant(request, oldRestaurant) { type: "Point", coordinates: request.coordinates, }, + placesId: request.placesId, imgUrl: img, workingHours: request.workingHours, description: sanitizer.sanitize.keepUnicode(request.description), @@ -77,6 +78,7 @@ export async function createRestaurant(request, oldRestaurant) { type: "Point", coordinates: request.coordinates, }, + placesId: request.placesId, imgUrl: img, workingHours: request.workingHours, description: sanitizer.sanitize.keepUnicode(request.description),