29 lines
477 B
JavaScript
Raw Normal View History

2015-10-22 17:54:43 +02:00
'use strict';
/**
* Module dependencies
*/
// Local node modules.
const routeService = require('./helpers');
/**
* Returns the config of the application used
2015-10-30 13:13:32 +01:00
* by the dashboard
2015-10-22 17:54:43 +02:00
*/
2015-10-27 11:59:38 +01:00
module.exports = function *() {
2015-10-22 17:54:43 +02:00
let routes;
let routesFound;
try {
routes = this.request.body;
2015-10-27 11:59:38 +01:00
yield routeService.update(routes);
2015-10-22 17:54:43 +02:00
routesFound = yield routeService.find();
this.body = routesFound;
} catch (err) {
this.status = 500;
this.body = err;
}
};