Skip to content

Commit 59523d6

Browse files
authored
Merge pull request #181 from cap-js-community/srv.entities
fix: `srv.entities('namespace')` is not an official API
2 parents 184e3ab + 16eccf2 commit 59523d6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

test/_env/srv/handlers/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
22

33
module.exports = (srv) => {
4-
const { Header } = srv.entities();
4+
const { Header } = srv.entities;
55

66
srv.on("wsContext", async () => {});
77

test/_env/srv/handlers/odata.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
22

33
module.exports = (srv) => {
4-
const { Header, HeaderItem } = srv.entities();
4+
const { Header, HeaderItem } = srv.entities;
55

66
srv.before("CREATE", Header, async (req) => {
77
await srv.emit("received", req.data);

test/_env/srv/handlers/todo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = class TodoService extends cds.ApplicationService {
77
super.init();
88

99
this.after("*", (data, context) => {
10-
const { Todo } = this.entities();
10+
const { Todo } = this.entities;
1111
context.on("succeeded", async () => {
1212
const ID = context.params?.[0]?.ID;
1313
if (ID && context.target === Todo && ["CREATE", "UPDATE", "DELETE"].includes(context.event)) {

0 commit comments

Comments
 (0)