-
{{travel.date | date:"dd/MM HH:mm a"}}
+
Collectivized
+
can carry package
diff --git a/app/www/templates/travels.html b/app/www/templates/travels.html
index eb22e31..91219c7 100644
--- a/app/www/templates/travels.html
+++ b/app/www/templates/travels.html
@@ -19,8 +19,10 @@
nºseats: {{travel.seats}}
nºpeople: {{travel.seats}}
-
{{travel.owner}}
-
{{travel.date | date:"dd/MM HH:mm a"}}
+
+
{{travel.date | date:"dd/MM HH:mm a"}}
+
{{travel.owner}}
+
diff --git a/app/www/templates/user.html b/app/www/templates/user.html
new file mode 100644
index 0000000..3f3c8dd
--- /dev/null
+++ b/app/www/templates/user.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+
{{user.username}}
+
+
+
{{user.description}}
+
{{user.mail}}
+
+ {{user.telegram}}
+
+
+
+
diff --git a/app/www/templates/users.html b/app/www/templates/users.html
new file mode 100644
index 0000000..7b43891
--- /dev/null
+++ b/app/www/templates/users.html
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
diff --git a/server/controllers/travelController.js b/server/controllers/travelController.js
index eeab174..62c6174 100644
--- a/server/controllers/travelController.js
+++ b/server/controllers/travelController.js
@@ -28,7 +28,7 @@ exports.findById = function(req, res) {
exports.findAllTravelsFromUsername = function(req, res) {
travelModel.find({
- authorname: req.params.userid
+ _id: req.params.userid
}, function(err, travels) {
if (err) throw err;
diff --git a/server/controllers/userController.js b/server/controllers/userController.js
index da36ca5..e9ef907 100644
--- a/server/controllers/userController.js
+++ b/server/controllers/userController.js
@@ -42,7 +42,8 @@ exports.findUserByUsername = function(req, res) {
} else if (user) {
console.log(user);
// return the information including token as JSON
- res.jsonp(user);
+ //res.jsonp(user);
+ res.status(200).jsonp(user[0]);
}
@@ -61,7 +62,8 @@ exports.addUser = function(req, res) {
description: req.body.description,
avatar: req.body.avatar,
mail: req.body.mail,
- admin: req.body.admin
+ phone: req.body.phone,
+ telegram: req.body.telegram
});
user.save(function(err, user) {
@@ -78,7 +80,8 @@ exports.updateUser = function(req, res) {
user.description = req.body.description;
user.avatar = req.body.avatar;
user.mail = req.body.mail;
- user.admin = req.body.admin;
+ user.phone = req.body.phone;
+ user.telegram = req.body.telegram;
user.save(function(err) {
if(err) return res.send(500, err.message);
diff --git a/server/models/userModel.js b/server/models/userModel.js
index 3fbd11e..1f9e36d 100644
--- a/server/models/userModel.js
+++ b/server/models/userModel.js
@@ -8,6 +8,7 @@ var userSchema = new Schema({
description: { type: String },
avatar: { type: String },
mail: { type: String },
- phone: { type: String }
+ phone: { type: String },
+ telegram: { type: String }
})
module.exports = mongoose.model('userModel', userSchema);