mirror of
https://github.com/strapi/strapi.git
synced 2025-07-17 05:53:01 +00:00
32 lines
527 B
JavaScript
32 lines
527 B
JavaScript
![]() |
'use strict';
|
||
|
|
||
|
/**
|
||
|
* Module dependencies
|
||
|
*/
|
||
|
|
||
|
// Public node modules.
|
||
|
const _ = require('lodash');
|
||
|
|
||
|
// Local node modules.
|
||
|
const routeService = require('./helpers');
|
||
|
|
||
|
/**
|
||
|
* Returns the config of the application used
|
||
|
* by the admin panel
|
||
|
*/
|
||
|
|
||
|
module.exports = function * () {
|
||
|
let routes;
|
||
|
let routesFound;
|
||
|
|
||
|
try {
|
||
|
routes = this.request.body;
|
||
|
yield updateRoutes(routes);
|
||
|
routesFound = yield routeService.find();
|
||
|
this.body = routesFound;
|
||
|
} catch (err) {
|
||
|
this.status = 500;
|
||
|
this.body = err;
|
||
|
}
|
||
|
};
|