@sap/cds 5.8.3 → 5.8.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,13 @@
|
|
|
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 5.8.4 - 2022-03-17
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- `UPDATE` singleton entity does not require to provide singleton keys in a payload
|
|
12
|
+
- CQN queries with operator expressions (`xpr`) in ON-conditions of unmanaged associations and compositions
|
|
13
|
+
|
|
7
14
|
## Version 5.8.3 - 2022-03-01
|
|
8
15
|
|
|
9
16
|
### Fixed
|
|
@@ -7,6 +7,7 @@ const replaceManagedData = require('../utils/dollar')
|
|
|
7
7
|
const { deepCopyArray } = require('../utils/copy')
|
|
8
8
|
|
|
9
9
|
const onlyKeysRemain = require('../utils/onlyKeysRemain')
|
|
10
|
+
const { getColumns } = require('../../cds-services/services/utils/columns')
|
|
10
11
|
|
|
11
12
|
const _targetEntityDoesNotExist = async req => {
|
|
12
13
|
const { query } = req
|
|
@@ -98,10 +99,11 @@ module.exports = cds.service.impl(function () {
|
|
|
98
99
|
result = req.data
|
|
99
100
|
}
|
|
100
101
|
|
|
101
|
-
if (req.event
|
|
102
|
-
if (!req.target['@odata.singleton.nullable']) req.reject(400, 'SINGLETON_NOT_NULLABLE')
|
|
103
|
-
|
|
104
|
-
const
|
|
102
|
+
if (req.event in { DELETE: 1, UPDATE: 1 } && req.target && req.target._isSingleton) {
|
|
103
|
+
if (req.event === 'DELETE' && !req.target['@odata.singleton.nullable']) req.reject(400, 'SINGLETON_NOT_NULLABLE')
|
|
104
|
+
const keyColumns = getColumns(req.target, { onlyNames: true, keysOnly: true })
|
|
105
|
+
const selectSingleton = SELECT.one(req.target).columns(keyColumns)
|
|
106
|
+
const singleton = await cds.tx(req).run(selectSingleton)
|
|
105
107
|
if (!singleton) req.reject(404)
|
|
106
108
|
req.query.where(singleton)
|
|
107
109
|
}
|