Public API for a society manager application

view-society.js 437B

1234567891011121314151617181920
  1. var society_controller = require("./../../presenters/society-controller.js");
  2. module.exports = {
  3. perform: function (a,b) {
  4. perform(a,b);
  5. }
  6. }
  7. var perform = function (req, res) {
  8. if (req.params.societyid) {
  9. society_controller.get_society(req.params.societyid, function (result) {
  10. res.send(result);
  11. });
  12. } else {
  13. society_controller.get_all_societies(function (result) {
  14. res.send(result);
  15. });
  16. }
  17. };