Fixing bug on collection deletion
Extending Admin Interface Adding cleanup procedure, that clears undeleted collection data
This commit is contained in:
@ -37,8 +37,22 @@ Handlebars.registerHelper('ifCond', function (v1, operator, v2, options) {
|
||||
|
||||
|
||||
const cache = new Map<string, Handlebars.TemplateDelegate>();
|
||||
const htmlCache = new Map<string, string>();
|
||||
|
||||
export default function getTemplate(name: string) {
|
||||
export function getView(name: string) {
|
||||
let tl: string;
|
||||
if (!config.dev)
|
||||
tl = htmlCache.get(name);
|
||||
|
||||
if (!tl) {
|
||||
tl = readFileSync(`./views/${name}.html`).toString();
|
||||
htmlCache.set(name, tl);
|
||||
}
|
||||
|
||||
return tl;
|
||||
}
|
||||
|
||||
export function getTemplate(name: string) {
|
||||
let tl: Handlebars.TemplateDelegate;
|
||||
if (!config.dev)
|
||||
tl = cache.get(name);
|
||||
|
Reference in New Issue
Block a user