mirror of
https://github.com/directus/directus.git
synced 2026-02-05 11:04:55 -05:00
* Delete unused styles from linear progress * Allow vuei18n result as name in table haeder * Rename createX to defineX * Fix styling glitch in private view
19 lines
405 B
TypeScript
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;
|
|
}
|