organize general routes

This commit is contained in:
Arjun Patel
2019-01-19 00:42:56 -08:00
parent 59c327d8df
commit fc2b73b715
18 changed files with 154 additions and 83 deletions
@@ -0,0 +1,16 @@
const db = require('../../config/db.config.js'),
errorMaker = require('../../helpers/error.maker');
const { Grant, Cause, Region, Organization } = db;
// FETCH all organizations
exports.findAll = (req, res, next) => {
Organization.findAll()
.then(organizations => {
res.status(200).json({
organizations,
number_items: organizations.length
});
})
.catch(error => next(error));
};