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) { } else if (tribeId) {
//enumvalues is a reference of objectname.key //enumvalues is a reference of objectname.key
const { tribeId, obj, keyid } = enumvalues.split("."); 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 { } else {
return true; return true;
} }

View File

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

View File

@ -113,13 +113,13 @@ Pagans.keyrecovery = (emailalias, tribe, search, lg) => {
**/ **/
Pagans.getalias = (alias) => { Pagans.getalias = (alias) => {
//bypass Odmdb cause all is public save ressources //bypass Odmdb cause all is public save ressources
console.log(path.resolve(`../objects/pagans/itm/${alias}.json`)); console.log(path.resolve(`../adminapi/objects/pagans/itm/${alias}.json`));
if (fs.existsSync(`../objects/pagans/itm/${alias}.json`)) { if (fs.existsSync(`../adminapi/objects/pagans/itm/${alias}.json`)) {
return { return {
status: 200, status: 200,
ref: "Pagans", ref: "Pagans",
msg: "aliasexist", msg: "aliasexist",
data: fs.readJSONSync(`../objects/pagans/itm/${alias}.json`), data: fs.readJSONSync(`../adminapi/objects/pagans/itm/${alias}.json`),
}; };
} else { } else {
return { return {
@ -200,7 +200,7 @@ Pagans.sendmailkey = (data) => {
person.avecpassphrase = person.passphrase != ""; person.avecpassphrase = person.passphrase != "";
let tplfile = `../${data.tribe}/template/createidentity_${data.lg}.js`; let tplfile = `../${data.tribe}/template/createidentity_${data.lg}.js`;
if (!fs.existsSync(tplfile)) { if (!fs.existsSync(tplfile)) {
tplfile = `../template/createidentity_${data.lg}.js`; tplfile = `..//${data.tribe}/template/createidentity_${data.lg}.js`;
if (!fs.existsSync(tplfile)) { if (!fs.existsSync(tplfile)) {
return { return {
status: 406, 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 // A faire plus tard charger tous les referentiele et les data pour une page adminpage
/* if (pagename=="pageadmin"){ /* if (pagename=="pageadmin"){
// load any referentialdata // 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")}`)){ if (!localstorage.schema.includes(`${tribe}/objects/${path.basename(f,".json")}`)){
localstorage.schema.push(`${tribe}/objects/${path.basename(f,".json")}`) localstorage.schema.push(`${tribe}/objects/${path.basename(f,".json")}`)
} }