This commit is contained in:
philc 2024-11-16 18:26:46 +01:00
parent 10b2901b97
commit 43f18b4f66
4 changed files with 8 additions and 8 deletions

View File

@ -62,7 +62,7 @@ Checkjson.schema.properties.enum = (str, enumvalues) => {
} else if (tribeId) {
//enumvalues is a reference of objectname.key
const { tribeId, obj, keyid } = enumvalues.split(".");
return fs.existsSync(`../../../${tribeId}/schema/${obj}/itm/${keyid}.json`);
return fs.existsSync(`../${tribeId}/schema/${obj}/itm/${keyid}.json`);
} else {
return true;
}

View File

@ -42,10 +42,10 @@ Nations.updateobjectsfromfreshesttown = (dnstownlist, objectidx) => {
objlist.forEach((o) => {
let objconf = {
name: o,
schema: `../../schema/${o}.jsons`,
schema: `../adminapi/schema/${o}.jsons`,
lastupdate: -1,
};
if (fs.existsSync(`../../${o}/conf.json`)) {
if (fs.existsSync(`../adminapi/${o}/conf.json`)) {
objconf = fs.readJsonSync(`../../${o}/conf.json`);
} else {
fs.outputJsonSync(`../../${o}/conf.json`, objconf);

View File

@ -113,13 +113,13 @@ Pagans.keyrecovery = (emailalias, tribe, search, lg) => {
**/
Pagans.getalias = (alias) => {
//bypass Odmdb cause all is public save ressources
console.log(path.resolve(`../objects/pagans/itm/${alias}.json`));
if (fs.existsSync(`../objects/pagans/itm/${alias}.json`)) {
console.log(path.resolve(`../adminapi/objects/pagans/itm/${alias}.json`));
if (fs.existsSync(`../adminapi/objects/pagans/itm/${alias}.json`)) {
return {
status: 200,
ref: "Pagans",
msg: "aliasexist",
data: fs.readJSONSync(`../objects/pagans/itm/${alias}.json`),
data: fs.readJSONSync(`../adminapi/objects/pagans/itm/${alias}.json`),
};
} else {
return {
@ -200,7 +200,7 @@ Pagans.sendmailkey = (data) => {
person.avecpassphrase = person.passphrase != "";
let tplfile = `../${data.tribe}/template/createidentity_${data.lg}.js`;
if (!fs.existsSync(tplfile)) {
tplfile = `../template/createidentity_${data.lg}.js`;
tplfile = `..//${data.tribe}/template/createidentity_${data.lg}.js`;
if (!fs.existsSync(tplfile)) {
return {
status: 406,

View File

@ -71,7 +71,7 @@ Wwws.initlocaldata = (tribe, appname, pagename, version, profils, lg) => {
// A faire plus tard charger tous les referentiele et les data pour une page adminpage
/* if (pagename=="pageadmin"){
// load any referentialdata
glob.Sync(`../../${tribe}/objects/*.json`).forEach(f=>{
glob.Sync(`../${tribe}/objects/*.json`).forEach(f=>{
if (!localstorage.schema.includes(`${tribe}/objects/${path.basename(f,".json")}`)){
localstorage.schema.push(`${tribe}/objects/${path.basename(f,".json")}`)
}