Files
directus/src/modules/define.ts
Rijk van Zanten 2c5a56acfc Create define (#156)
* Delete unused styles from linear progress

* Allow vuei18n result as name in table haeder

* Rename createX to defineX

* Fix styling glitch in private view
2020-03-11 11:33:57 -04:00

19 lines
405 B
TypeScript

import { i18n } from '@/lang/';
import { Module, ModuleOptions, ModuleContext } from './types';
export function defineModule(options: ModuleOptions): Module {
const context: ModuleContext = { i18n };
const config = {
id: options.id,
...options.register(context)
};
config.routes = config.routes.map(route => ({
...route,
path: `/:project/${config.id}${route.path}`
}));
return config;
}