New support: fixes

This commit is contained in:
yflory 2024-02-27 18:00:23 +01:00
parent 9692659a05
commit dacb91e81c
2 changed files with 8 additions and 1 deletions

View file

@ -11,6 +11,11 @@ const Util = require("../common-util");
Moderators.getAll = (Env, cb) => {
Moderator.getAll(Env, (err, data) => {
if (err) { return void cb(err); }
let res = {};
Object.keys(data).forEach(safeKey => {
const unsafeKey = Util.unescapeKeyCharacters(safeKey);
res[unsafeKey] = data[safeKey];
});
cb(null, data);
});
};

View file

@ -543,7 +543,9 @@ var makeRouteCache = function (template, cacheName) {
}
// successive calls to this function
cleanUp[cacheKey]();
if (typeof (cleanUp[cacheKey]) === "function") {
cleanUp[cacheKey]();
}
return void res.send(cache[cacheKey]);
};
};