1
0
forked from apxtri/apxtri

clean odmdb.js

This commit is contained in:
philc 2024-03-07 08:00:02 +01:00
parent a2ceae118e
commit 17a1978dd4

View File

@ -24,7 +24,7 @@ const router = express.Router();
*/
router.get("/objects", checkHeaders, isAuthenticated, (req, res) => {
const data = {
tribe: req.session.headers.xtribe,
tribe: req.session.header.xtribe,
apx: { conf: {}, objectnames: [] },
tribe: { conf: {}, objectnames: [] },
};
@ -37,7 +37,7 @@ router.get("/objects", checkHeaders, isAuthenticated, (req, res) => {
}
});
glob
.sync(`../nationchains/tribes/${req.session.headers.xtribe}/schema/*.json`)
.sync(`../nationchains/tribes/${req.session.header.xtribe}/schema/*.json`)
.forEach((f) => {
const objectname = path.basename(f, ".json");
if (objectname == "conf") {
@ -80,7 +80,7 @@ router.get(
// indexname = objectname_key_value.json
let objectLocation = "../nationchains/";
if (!conf.api.nationObjects.includes(req.params.objectname)) {
objectLocation += `tribes/${req.session.headers.xtribe}/`;
objectLocation += `tribes/${req.session.header.xtribe}/`;
// check if accessright
}
const indexpath = `${objectLocation}/${req.params.objectname}/idx/${req.params.indexname}`;