Public API for a society manager application

add-friend.js 482B

123456789101112131415161718192021222324
  1. var user_controller = require("./../../presenters/user-controller.js");
  2. module.exports = {
  3. perform: function (a,b) {
  4. perform(a,b);
  5. }
  6. }
  7. var perform = function (req, res) {
  8. var friend = req.body.friend || req.query.friend;
  9. var auth = req.body.auth || req.query.auth;
  10. if (friend && auth) {
  11. user_controller.add_friend(friend, auth, function (response) {
  12. res.send(response);
  13. });
  14. } else {
  15. res.send({
  16. "success": 0,
  17. "error": 4
  18. })
  19. }
  20. };