diff --git a/apxtri/models/Wwws.js b/apxtri/models/Wwws.js index 88275c0..9d73aea 100644 --- a/apxtri/models/Wwws.js +++ b/apxtri/models/Wwws.js @@ -44,8 +44,46 @@ Wwws.getwco = (wconame, ctx) => { console.log("@todo don't forget to manage accessright to wco in Wwws"); //check that all tpl, tpldata, ... are available for this pagename const webconf = `../${ctx.tribe}/objects/wwws/itm/${ctx.xapp}.json`; + const webpageinit = { + dns: [], + apxtri: { + headers: { + xtrkversion: 1, + xalias: "anonymous", + xapp: "recruiter", + xdays: 0, + xhash: "anonymous", + xlang: "en", + xprofils: "anonymous", + xtribe: "smatchit", + xuuid: "0", + }, + }, + tailwindcsscontent: [ + `../${ctx.tribe}/objects/wwws/${ctx.xapp}/src/**/*.{html,js,mustache}`, + `../${ctx.tribe}/objects/wco/**/*.{html,js,mustache}`, + "../adminapi/objects/wco/apx/*.{html,js,mustache}", + "../adminapi/objects/wco/tracker/*.{html,js,mustache}", + ], + pages: {}, + }; + webpageinit.pages[ctx.pagename] = { + version: 1, + confpage: { + language: ["en"], + profils: ["anonymous"], + itms: {}, + tpl: {}, + options: {}, + ref: {}, + schema: [], + tpldata: {}, + }, + }; const wcoinfo = fs.readJSONSync(wcoconf); - const webpage = fs.readJSONSync(webconf); + const webpage = fs.existsSync(webconf) + ? fs.readJSONSync(webconf) + : webpageinit; // check that webconf for tailwindcsscontent property exist for this wco request const pathtocheckfortw = [ `../adminapi/objects/wco/${wconame}/*.{html,js,mustache}`,