mirror of
https://github.com/Unleash/unleash.git
synced 2024-10-18 20:09:08 +02:00
23 lines
557 B
JavaScript
23 lines
557 B
JavaScript
|
'use strict';
|
||
|
|
||
|
const Controller = require('../controller');
|
||
|
|
||
|
const version = 1;
|
||
|
|
||
|
class FeatureTypeController extends Controller {
|
||
|
constructor(config) {
|
||
|
super(config);
|
||
|
this.featureTypeStore = config.stores.featureTypeStore;
|
||
|
this.logger = config.getLogger('/admin-api/feature-type.js');
|
||
|
|
||
|
this.get('/', this.getAllFeatureTypes);
|
||
|
}
|
||
|
|
||
|
async getAllFeatureTypes(req, res) {
|
||
|
const types = await this.featureTypeStore.getAll();
|
||
|
res.json({ version, types });
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = FeatureTypeController;
|