const fetch = require('node-fetch');
const log = require('../common/log');

function getFeatures(req, res, orgId) {
    let requestUrl = `${req.context.config.api.directory}/admin/organizations/${orgId || req.params.org_id}/features/`;
    return log(fetch)(requestUrl, { method: 'get', headers: req.context.headers })
        .then(response => response.json())
        .catch(error => {});
}

module.exports = getFeatures;
