Skip to content

Commit 576830b

Browse files
committed
cds v9 5
1 parent fbe455a commit 576830b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

example-cap-server/srv/service/check-service.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use strict";
22

3+
const cds = require("@sap/cds");
34
const toggles = require("@cap-js-community/feature-toggle-library");
45

56
const { CHECK_API_PRIORITY } = require("../feature");
@@ -13,7 +14,7 @@ const HIGH_VALUE_RESPONSES = ["well done", "full success", "huzzah", "celebratio
1314
const HIGH_BOUNDARY = 100;
1415

1516
const priorityHandler = async (context) => {
16-
const { "CheckService.priority": priority } = context.model.definitions; // TODO doesn't work
17+
const { "CheckService.priority": priority } = (cds.context.model ?? cds.model).definitions;
1718
const isFtsToggled = Boolean(priority["@marked"]);
1819
const value = toggles.getFeatureValue(CHECK_API_PRIORITY, { user: context.user.id, tenant: context.tenant });
1920
const messages =

0 commit comments

Comments
 (0)