This commit is contained in:
2024-04-02 21:45:18 +02:00
parent 3ad68d4872
commit 033232eba1
2 changed files with 58 additions and 69 deletions

View File

@@ -232,7 +232,7 @@ Odmdb.Schema = (objectPathname, validschema, lg="en") => {
res.data.schema.properties[p].type == "object" &&
res.data.schema.properties[p]["$ref"]
) {
const subschema = path.resolve(`${objectPathname}/${res.data.schema.properties[p]["$ref"]}.json`);
const subschema = path.resolve(`../../${res.data.schema.properties[p]["$ref"]}.json`);
if (Object.keys(res.data.schema).length == 0) {
res.status = 404;
res.msg = "missingref";
@@ -250,7 +250,7 @@ Odmdb.Schema = (objectPathname, validschema, lg="en") => {
res.data.schema.properties[p].options &&
res.data.schema.properties[p].options["$ref"]
) {
const optionsfile = path.resolve(`${objectPathname}/${res.data.schema.properties[p].options["$ref"]}_${lg}.json`)
const optionsfile = path.resolve(`../../${res.data.schema.properties[p].options["$ref"]}_${lg}.json`)
if (log) console.log(currentmod,"Lien vers options:", optionsfile)
if (!fs.existsSync(optionsfile)){
res.status = 404;