mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
899 B
28 lines
899 B
<% |
|
const { utils, config, routes, modelTypes } = it; |
|
const { _, classNameCase } = utils; |
|
const dataContracts = config.modular ? _.map(modelTypes, "name") : []; |
|
%> |
|
|
|
<% if (dataContracts.length) { %> |
|
import { <%~ dataContracts.join(", ") %> } from "./<%~ config.fileNames.dataContracts %>" |
|
<% } %> |
|
|
|
<% |
|
/* TODO: outOfModule, combined should be attributes of route, which will allow to avoid duplication of code */ |
|
%> |
|
|
|
<% routes.outOfModule && routes.outOfModule.forEach(({ routes = [] }) => { %> |
|
<% routes.forEach((route) => { %> |
|
<%~ includeFile('@base/route-type.eta', { ...it, route }) %> |
|
<% }) %> |
|
<% }) %> |
|
|
|
<% routes.combined && routes.combined.forEach(({ routes = [], moduleName }) => { %> |
|
export namespace <%~ classNameCase(moduleName) %> { |
|
<% routes.forEach((route) => { %> |
|
<%~ includeFile('@base/route-type.eta', { ...it, route }) %> |
|
<% }) %> |
|
} |
|
|
|
<% }) %>
|
|
|