@sap/cds 9.0.3 → 9.1.0

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.
@@ -78,9 +78,7 @@ module.exports = cds.service.impl(function () {
78
78
  if (await _targetEntityDoesNotExist(req)) req.reject(404) // REVISIT: add a reasonable error message
79
79
  }
80
80
 
81
- // flag to trigger read after write in legacy odata adapter
82
- if (req.constructor.name in { ODataRequest: 1 }) req._.readAfterWrite = true
83
- if (req.protocol?.match(/odata/)) req._.readAfterWrite = true //> REVISIT for noah
81
+ if (req.protocol?.match(/odata/)) req._.readAfterWrite = true
84
82
 
85
83
  return req.data
86
84
  })
@@ -251,7 +251,7 @@ async function validate_input(req) {
251
251
  }
252
252
 
253
253
  const errs = cds.validate(req.data, req.target, assertOptions)
254
- if (errs) return req._errors.push(...errs)
254
+ if (errs) return errs.forEach(err => req.error(err))
255
255
 
256
256
  // -------------------------------------------------
257
257
  // REVISIT: is the below still needed?
@@ -332,7 +332,7 @@ function validate_action(req) {
332
332
  protocol: req.protocol
333
333
  }
334
334
  let errs = cds.validate(data, operation, assertOptions)
335
- if (errs) return req._errors.push(...errs)
335
+ if (errs) return errs.forEach(err => req.error(err))
336
336
 
337
337
  // REVISIT: we still need the following because cds.validate doesn't check for @mandatory params (both flat and nested)
338
338
  const errors = []
@@ -76,12 +76,6 @@ function handle_temporal_data(req) {
76
76
  _getDateFromQueryOptions(_queryOptions['sap-valid-to'] ?? normalizeTimestamp('9999-12-31T23:59:59.9999999Z'))
77
77
  )
78
78
  }
79
-
80
- // REVISIT: needed without okra
81
- if (req.constructor.name !== 'ODataRequest') {
82
- req._['VALID-FROM'] = _['VALID-FROM']
83
- req._['VALID-TO'] = _['VALID-TO']
84
- }
85
79
  }
86
80
  handle_temporal_data._initial = true
87
81