dobo 2.37.0 → 2.37.1
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/lib/factory/adapter.js
CHANGED
|
@@ -452,7 +452,7 @@ async function adapterFactory () {
|
|
|
452
452
|
if (!this.support.uniqueIndex) await this._checkUnique(model, body, options)
|
|
453
453
|
}
|
|
454
454
|
if (!options.noIdCheck && isSet(body.id)) {
|
|
455
|
-
const resp = await this.getRecord(model, body.id, { noMagic: true })
|
|
455
|
+
const resp = await this.getRecord(model, body.id, { ...options, noMagic: true })
|
|
456
456
|
if (!isEmpty(resp.data)) throw this.plugin.error('recordExists%s%s', body.id, model.name)
|
|
457
457
|
}
|
|
458
458
|
body = this.sanitizeBody(model, body)
|
|
@@ -536,7 +536,7 @@ async function adapterFactory () {
|
|
|
536
536
|
if (!this.support.uniqueIndex) await this._checkUnique(model, body, options)
|
|
537
537
|
}
|
|
538
538
|
if (!options._data) {
|
|
539
|
-
const resp = await this.getRecord(model, id, { noMagic: true })
|
|
539
|
+
const resp = await this.getRecord(model, id, { ...options, noMagic: true })
|
|
540
540
|
if (!resp.data) throw this.plugin.error('recordNotFound%s%s', id, model.name)
|
|
541
541
|
options._data = resp.data
|
|
542
542
|
}
|
|
@@ -573,7 +573,7 @@ async function adapterFactory () {
|
|
|
573
573
|
}
|
|
574
574
|
if (isSet(body.id)) {
|
|
575
575
|
if (!options._data) {
|
|
576
|
-
const resp = await this.getRecord(model, body.id, { noMagic: true })
|
|
576
|
+
const resp = await this.getRecord(model, body.id, { ...options, noMagic: true })
|
|
577
577
|
if (!resp.data) throw this.plugin.error('recordNotFound%s%s', body.id, model.name)
|
|
578
578
|
options._data = resp.data
|
|
579
579
|
}
|
|
@@ -604,7 +604,7 @@ async function adapterFactory () {
|
|
|
604
604
|
*/
|
|
605
605
|
async _removeRecord (model, id, options = {}) {
|
|
606
606
|
if (!options._data) {
|
|
607
|
-
const resp = await this.getRecord(model, id, { noMagic: true })
|
|
607
|
+
const resp = await this.getRecord(model, id, { ...options, noMagic: true })
|
|
608
608
|
if (!resp.data) throw this.plugin.error('recordNotFound%s%s', id, model.name)
|
|
609
609
|
options._data = resp.data
|
|
610
610
|
}
|
|
@@ -47,7 +47,7 @@ async function sanitizeFixture (params = {}, opts = {}) {
|
|
|
47
47
|
if (val === null) body[key] = undefined
|
|
48
48
|
else {
|
|
49
49
|
const prop = this.properties.find(item => item.name === key)
|
|
50
|
-
if (prop && ['string', 'text'].includes(prop.type)) body[key] += ''
|
|
50
|
+
if (prop && ['string', 'text'].includes(prop.type) && isSet(body[key])) body[key] += ''
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
return body
|
package/lib/factory/model.js
CHANGED
|
@@ -450,6 +450,7 @@ async function modelFactory () {
|
|
|
450
450
|
for (const key in lookupValue) {
|
|
451
451
|
query = query.replaceAll(`{${key}}`, lookupValue[key])
|
|
452
452
|
}
|
|
453
|
+
if (query.includes('{') && query.includes('}')) return null
|
|
453
454
|
if (isEmpty(field)) field = 'id'
|
|
454
455
|
const { getModel } = this.app.dobo
|
|
455
456
|
const ref = getModel(model)
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-08-13
|
|
4
|
+
|
|
5
|
+
- [2.37.1] Bug fix in `adapter.js` to pass options when calling `getRecord()`
|
|
6
|
+
- [2.37.1] Bug fix in `model._simpleLookup()` to return `null` if query string is not right
|
|
7
|
+
- [2.37.1] Bug fix in `model.sanitizeFixture()` to not sanitize value that is `null` or `undefined`
|
|
8
|
+
|
|
3
9
|
## 2026-08-06
|
|
4
10
|
|
|
5
11
|
- [2.37.0] Update `memory.connect()` to use the new `app.lib.setInterval()`
|