From 938aaf96d56343a553157c831d19cde3ede78a1e Mon Sep 17 00:00:00 2001 From: Zongqi Chen Date: Mon, 13 Jan 2025 16:06:10 +0100 Subject: [PATCH] use model instead of file --- lib/ord.js | 3 ++- lib/plugin.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ord.js b/lib/ord.js index 862517a..ba13a5d 100644 --- a/lib/ord.js +++ b/lib/ord.js @@ -49,7 +49,8 @@ const initializeAppConfig = (csn) => { switch (keyDefinition.kind) { case CDS_ELEMENT_KIND.service: // Patch: hidden mtx - if (!keyDefinition["@cds.external"] && !key.includes("mtx")) { + if (!keyDefinition["@cds.external"]) { + Logger.info(key) serviceNames.push(key); } break; diff --git a/lib/plugin.js b/lib/plugin.js index e279c78..b877507 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -20,7 +20,7 @@ cds.on("bootstrap", (app) => { app.get("/open-resource-discovery/v1/documents/1", async (req, res) => { try { - const csn = await cds.load(cds.env.folders.srv); + const csn = cds.model; const data = ord(csn); return res.status(200).send(data); } catch (error) {