dobo 2.8.1 → 2.8.3
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.
|
@@ -6,7 +6,7 @@ async function attachment (req, reply) {
|
|
|
6
6
|
const { routePath } = this.app.waibu
|
|
7
7
|
const { fs } = this.app.lib
|
|
8
8
|
const mdl = this.app.dobo.getModel(req.params.model)
|
|
9
|
-
const items = await mdl.listAttachments({ id: req.params.id, fieldName: req.params.field, file: '*' })
|
|
9
|
+
const items = (await mdl.listAttachments({ id: req.params.id, fieldName: req.params.field, file: '*' })) ?? []
|
|
10
10
|
let item = req.params.file === '_first' ? items[0] : undefined
|
|
11
11
|
if (!item) {
|
|
12
12
|
item = find(items, i => {
|
package/index.js
CHANGED
package/lib/collect-models.js
CHANGED
|
@@ -302,11 +302,12 @@ async function collectModels () {
|
|
|
302
302
|
await eachPlugins(async function ({ file }) {
|
|
303
303
|
const { readConfig } = this.app.bajo
|
|
304
304
|
const { pascalCase } = this.app.lib.aneka
|
|
305
|
-
const { isPlainObject } = this.app.lib._
|
|
305
|
+
const { isPlainObject, isEmpty } = this.app.lib._
|
|
306
306
|
|
|
307
307
|
const base = path.basename(file, path.extname(file))
|
|
308
308
|
const defName = pascalCase(`${this.alias} ${base}`)
|
|
309
309
|
const item = await readConfig(file, { ns: this.ns, ignoreError: true })
|
|
310
|
+
if (isEmpty(item)) return undefined
|
|
310
311
|
if (!isPlainObject(item)) me.fatal('invalidModel%s', defName)
|
|
311
312
|
item.name = item.name ?? defName
|
|
312
313
|
item.collName = item.collName ?? item.name
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-02-25
|
|
4
|
+
|
|
5
|
+
- [2.8.3] Bug fix on attachment route
|
|
6
|
+
|
|
7
|
+
## 2026-02-24
|
|
8
|
+
|
|
9
|
+
- [2.8.2] Bug fix on field type ```textType```
|
|
10
|
+
- [2.8.2] Bug fix on ```collect-models.js``` when empty model is returned
|
|
11
|
+
|
|
3
12
|
## 2026-02-23
|
|
4
13
|
|
|
5
14
|
- [2.8.1] Bug fix on ```memory._getCursor()```
|