Browse Source

moving and renaming

master
arnaucode 6 years ago
parent
commit
c740686ab0
23 changed files with 49 additions and 10 deletions
  1. +0
    -0
      .gitignore
  2. +0
    -0
      LICENSE
  3. +6
    -6
      README.md
  4. +0
    -0
      adminConfig.js
  5. +0
    -0
      config.js
  6. +40
    -4
      controllers/adminController.js
  7. +0
    -0
      controllers/searchController.js
  8. +0
    -0
      controllers/travelController.js
  9. +0
    -0
      controllers/userController.js
  10. +0
    -0
      models/adminModel.js
  11. +0
    -0
      models/commentModel.js
  12. +0
    -0
      models/notificationModel.js
  13. +0
    -0
      models/travelModel.js
  14. +0
    -0
      models/userModel.js
  15. +0
    -0
      package.json
  16. +3
    -0
      server.js
  17. +0
    -0
      testSendImage.js
  18. +0
    -0
      tests.js
  19. +0
    -0
      tests/config.json
  20. +0
    -0
      tests/main.go
  21. +0
    -0
      tests/readConfig.go
  22. +0
    -0
      tests/requests.go
  23. +0
    -0
      tests/users.json

+ 0
- 0
.gitignore


+ 0
- 0
LICENSE


+ 6
- 6
README.md

@ -1,9 +1,9 @@
# CarsInCommonServer
# commonroutesServer
- server code: https://github.com/arnaucode/carsincommonServer
- frontend app code: https://github.com/arnaucode/carsincommonApp
- server code: https://github.com/arnaucode/commonroutesServer
- frontend app code: https://github.com/arnaucode/commonroutesApp
- images server: https://github.com/arnaucode/goImgServer
- admin web: https://github.com/arnaucode/carsincommonAdminWeb
- admin web: https://github.com/arnaucode/commonroutesAdminWeb
**Backend:**
@ -18,8 +18,8 @@
App:
![carsincommon](https://raw.githubusercontent.com/arnaucode/carsincommonApp/master/carsincommon.png "carsincommon")
code: https://github.com/arnaucode/carsincommonApp
![commonroutes](https://raw.githubusercontent.com/arnaucode/commonroutesApp/master/commonroutes.png "commonroutes")
code: https://github.com/arnaucode/commonroutesApp
--------------------

+ 0
- 0
adminConfig.js


+ 0
- 0
config.js


+ 40
- 4
controllers/adminController.js

@ -113,6 +113,15 @@ exports.login = function(req, res) {
});
};
exports.getAllAdmins = function(req, res) {
adminModel.find()
.limit(pageSize)
.skip(pageSize * Number(req.query.page))
.exec(function(err, admins) {
if (err) return res.send(500, err.message);
res.status(200).jsonp(admins);
});
};
exports.changePassword = function(req, res) {
//if(req.body.)
userModel.update({
@ -534,9 +543,22 @@ exports.validateUser = function(req, res) {
user.validated = true;
user.validatedBy = admin._id;
user.save(function(err, user) {
var notification = new notificationModel({
concept: "admin",
message: "an admin has validated your account",
date: new Date(),
icon: 'admin',
link: "users/" + user._id,
user: user._id
});
notification.save(function(err, notification) {
if (err) return res.send(500, err.message);
userController.getUserById(req, res);
user.notifications.push(notification._id);
user.save(function(err, user) {
if (err) return res.send(500, err.message);
userController.getUserById(req, res);
});
});
});
}
@ -563,10 +585,24 @@ exports.unvalidateUser = function(req, res) {
user.validated = false;
user.validatedBy = admin._id;
user.save(function(err, user) {
var notification = new notificationModel({
concept: "admin",
message: "an admin has unvalidated your account",
date: new Date(),
icon: 'admin',
link: "users/" + user._id,
user: user._id
});
notification.save(function(err, notification) {
if (err) return res.send(500, err.message);
userController.getUserById(req, res);
user.notifications.push(notification._id);
user.save(function(err, user) {
if (err) return res.send(500, err.message);
userController.getUserById(req, res);
});
});
});
}
});

+ 0
- 0
controllers/searchController.js


+ 0
- 0
controllers/travelController.js


+ 0
- 0
controllers/userController.js


+ 0
- 0
models/adminModel.js


+ 0
- 0
models/commentModel.js


+ 0
- 0
models/notificationModel.js


+ 0
- 0
models/travelModel.js


+ 0
- 0
models/userModel.js


+ 0
- 0
package.json


+ 3
- 0
server.js

@ -118,6 +118,9 @@ apiRoutes.use(function(req, res, next) {
}); //fi verificació de token
//admin
apiRoutes.route('/admins')
.get(adminCtrl.getAllAdmins);
apiRoutes.route('/admin/network')
.get(adminCtrl.network);
apiRoutes.route('/admin/user/network/:userid')

+ 0
- 0
testSendImage.js


+ 0
- 0
tests.js


+ 0
- 0
tests/config.json


+ 0
- 0
tests/main.go


+ 0
- 0
tests/readConfig.go


+ 0
- 0
tests/requests.go


+ 0
- 0
tests/users.json


Loading…
Cancel
Save