dobo 2.11.4 → 2.12.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.
package/.bootorder ADDED
@@ -0,0 +1 @@
1
+ 10
@@ -238,7 +238,7 @@ async function validate (body, joiModel, opts = {}) {
238
238
  try {
239
239
  return await joiModel.validateAsync(body, params)
240
240
  } catch (err) {
241
- const payload = { details: err.details, statusCode: 422, code: 'DB_VALIDATION' }
241
+ const payload = { details: err.details, statusCode: 422, code: 'DB_VALIDATION', model: this.name }
242
242
  if (err.values) payload.values = err.values
243
243
  throw this.plugin.error('validationError', payload)
244
244
  }
@@ -109,7 +109,9 @@ async function modelFactory () {
109
109
  if (isEmpty(field)) field = 'id'
110
110
  const { getModel } = this.app.dobo
111
111
  const ref = getModel(model)
112
- const rec = await ref.findOneRecord({ query }, { noHook: true, noCache: true, ...options })
112
+ const opts = { noHook: true, noCache: true, ...options }
113
+ opts.dataOnly = true
114
+ const rec = await ref.findOneRecord({ query }, opts)
113
115
  return get(rec, field, null)
114
116
  }
115
117
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dobo",
3
- "version": "2.11.4",
3
+ "version": "2.12.0",
4
4
  "description": "DBMS for Bajo Framework",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-03-30
4
+
5
+ - [2.12.0] Add ```.bootorder``` level 10
6
+ - [2.12.0] Bug fix in ```model._simpleLookup()```
7
+ - [2.12.0] Add model name in validation error's payload
8
+
3
9
  ## 2026-03-26
4
10
 
5
11
  - [2.11.4] Exceptions thrown in ```getSingleRef()``` && ```getMultiRefs()``` will be catched and are ignored