Skip to content

Commit

Permalink
Feat: enable multitenancy and extensibility (#110)
Browse files Browse the repository at this point in the history
* add patch to hide mtx

* use model instead of file

* enable cds.model

* remove log

* update readme

---------

Co-authored-by: RoshniNaveenaS <[email protected]>
  • Loading branch information
zongqichen and RoshniNaveenaS authored Feb 24, 2025
1 parent 1afe860 commit 9680ecd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ require("@cap-js/ord");
```

```js
const csn = await cds.load(cds.env.folders.srv);
const csn = cds.context?.model || cds.model;
const ord = cds.compile.to.ord(csn);
```

Expand Down
2 changes: 1 addition & 1 deletion lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cds.on("bootstrap", async (app) => {
// ORD documents route: /ord/v1/documents/:documentName
app.get("/ord/v1/documents/:documentName", authenticate, async (_, res) => {
try {
const csn = await cds.load(cds.env.folders.srv);
const csn = cds.context?.model || cds.model;
const data = ord(csn);
return res.status(200).send(data);
} catch (error) {
Expand Down

0 comments on commit 9680ecd

Please sign in to comment.