@sap/cds 6.2.3 → 6.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@
4
4
  - The format is based on [Keep a Changelog](http://keepachangelog.com/).
5
5
  - This project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## Version 6.2.4 - 2022-11-04
8
+
9
+ ### Fixed
10
+
11
+ - Draft ownership was erroneously checked for bound actions on active instances
12
+
7
13
  ## Version 6.2.3 - 2022-10-21
8
14
 
9
15
  ### Fixed
@@ -77,7 +77,7 @@ const _getRoot = req => {
77
77
  return root
78
78
  }
79
79
 
80
- const _getDraftDataFromExistingDraft = async (req, root) => {
80
+ const _getDraftDataFromExistingDraft = async (req, root, isBoundAction) => {
81
81
  if (!root) return []
82
82
  if (root?.IsActiveEntity === false) {
83
83
  const query = _getSelectDraftDataCqn(root.entityName, root.where)
@@ -85,6 +85,9 @@ const _getDraftDataFromExistingDraft = async (req, root) => {
85
85
  return result
86
86
  }
87
87
 
88
+ // do not expect validate draft ownership for action call on active instances
89
+ if (isBoundAction) return []
90
+
88
91
  const rootWhere = getKeysCondition(req)
89
92
  const query = _getSelectDraftDataCqn(ensureNoDraftsSuffix(req.target.name), rootWhere)
90
93
  const result = await cds.tx(req).run(query)
@@ -147,8 +150,8 @@ const _deleteCancel = async function (req) {
147
150
  }
148
151
 
149
152
  const _validateDraftBoundAction = async function (req) {
150
- const result = await _getDraftDataFromExistingDraft(req, _getRoot(req))
151
153
  const isBoundAction = true
154
+ const result = await _getDraftDataFromExistingDraft(req, _getRoot(req), isBoundAction)
152
155
  if (result && result.length > 0) _validateDraft(req, result, isBoundAction)
153
156
  }
154
157
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sap/cds",
3
- "version": "6.2.3",
3
+ "version": "6.2.4",
4
4
  "description": "SAP Cloud Application Programming Model - CDS for Node.js",
5
5
  "homepage": "https://cap.cloud.sap/",
6
6
  "keywords": [