Explorar o código

Bug fix: updating location did not work correctly.

Lee Morgan %!s(int64=5) %!d(string=hai) anos
pai
achega
977078df52
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      controllers/gallery.js

+ 4 - 1
controllers/gallery.js

@@ -107,7 +107,10 @@ module.exports = {
 
                 response[1].title = req.body.title;
                 response[1].tags = req.body.tags.split(",");
-                response[1].location = req.body.location.split(", ");
+                response[1].location = {
+                    type: "Point",
+                    coordinates: req.body.location.split(", ")
+                };
 
                 let handleImage = (fileData)=>{
                     let fileString = `/galleryImages/${createId(25)}.jpg`;