dobo 2.26.4 → 2.27.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.
|
@@ -54,7 +54,9 @@ export async function execValidation (body, options = {}) {
|
|
|
54
54
|
const { validation = {} } = options
|
|
55
55
|
const fields = uniq([...Object.keys(body), ...(options.fields ?? [])])
|
|
56
56
|
await execHook.call(this, 'beforeRecordValidation', body, options)
|
|
57
|
+
await execModelHook.call(this, 'beforeRecordValidation', body, options)
|
|
57
58
|
const result = await this.validate(body, validation, { fields, ...options })
|
|
59
|
+
await execModelHook.call(this, 'afterRecordValidation', body, result, options)
|
|
58
60
|
await execHook.call(this, 'afterRecordValidation', body, result, options)
|
|
59
61
|
return result
|
|
60
62
|
}
|
|
@@ -9,7 +9,7 @@ async function countRecord (...args) {
|
|
|
9
9
|
const { dataOnly } = opts
|
|
10
10
|
const { filter, options } = await getFilterAndOptions.call(this, params, opts, action)
|
|
11
11
|
const { hardCap, t } = getDefaultValues(options)
|
|
12
|
-
await execHook.call(this, 'beforeCountRecord', options)
|
|
12
|
+
await execHook.call(this, 'beforeCountRecord', filter, options)
|
|
13
13
|
await execModelHook.call(this, 'beforeCountRecord', filter, options)
|
|
14
14
|
await execDynHook.call(this, 'beforeCountRecord', filter, options)
|
|
15
15
|
const result = (await this.driver._countRecord(this, filter, options)) ?? {}
|
|
@@ -34,7 +34,14 @@ async function loadFixtures ({ spinner, ignoreError = true, collectItems = false
|
|
|
34
34
|
}
|
|
35
35
|
const result = { success: 0, failed: 0 }
|
|
36
36
|
const items = await readConfig(`${this.plugin.ns}:/extend/dobo/fixture/${this.baseName}.*`, { ns: this.plugin.ns, baseNs: 'dobo', checkOverride: true, defValue: [] })
|
|
37
|
-
const opts = {
|
|
37
|
+
const opts = {
|
|
38
|
+
...options,
|
|
39
|
+
noModelHook: false,
|
|
40
|
+
noHook: true,
|
|
41
|
+
noDynHook: true,
|
|
42
|
+
noValidation: false,
|
|
43
|
+
noCache: true
|
|
44
|
+
}
|
|
38
45
|
for (const item of items) {
|
|
39
46
|
const lv = {}
|
|
40
47
|
const deleted = {}
|
|
@@ -70,14 +77,14 @@ async function loadFixtures ({ spinner, ignoreError = true, collectItems = false
|
|
|
70
77
|
for (const item of items) {
|
|
71
78
|
if (ignoreError) {
|
|
72
79
|
try {
|
|
73
|
-
await exec.call(this, { item, spinner, options, result, items })
|
|
80
|
+
await exec.call(this, { item, spinner, options: opts, result, items })
|
|
74
81
|
} catch (err) {
|
|
75
82
|
if (this.app.bajo.config.log.applet) console.error(err)
|
|
76
83
|
err.model = this.name
|
|
77
84
|
if (this.app.applet) this.plugin.print.fail(this.app.dobo.validationErrorMessage(err))
|
|
78
85
|
result.failed++
|
|
79
86
|
}
|
|
80
|
-
} else await exec.call(this, { item, spinner, options, result, items })
|
|
87
|
+
} else await exec.call(this, { item, spinner, options: opts, result, items })
|
|
81
88
|
}
|
|
82
89
|
return result
|
|
83
90
|
}
|
|
@@ -50,6 +50,11 @@ async function sanitizeRecord (record = {}, opts = {}) {
|
|
|
50
50
|
else {
|
|
51
51
|
const options = {
|
|
52
52
|
lang: get(opts, 'req.lang'),
|
|
53
|
+
datetime: {
|
|
54
|
+
dateStyle: get(opts, 'req.site.setting.sumba.dateStyle'),
|
|
55
|
+
timeStyle: get(opts, 'req.site.setting.sumba.timeStyle'),
|
|
56
|
+
timeZone: get(opts, 'req.site.setting.sumba.timeZone')
|
|
57
|
+
},
|
|
53
58
|
latitude: ['lat', 'latitude'].includes(key),
|
|
54
59
|
longitude: ['lon', 'lng', 'longitude'].includes(key)
|
|
55
60
|
}
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-05-30
|
|
4
|
+
|
|
5
|
+
- [2.27.0] Bug fix in ```model.transaction()```
|
|
6
|
+
- [2.27.0] Add ```model:[before|after]RecordValidation``` model hooks
|
|
7
|
+
- [2.27.0] Bug fix in ```model.countRecord()```
|
|
8
|
+
- [2.27.0] Bug fix in ```model.loadFixtures()```
|
|
9
|
+
- [2.27.1] Bug fix in ```model.sanitizeRecord()```
|
|
10
|
+
|
|
3
11
|
## 2026-05-29
|
|
4
12
|
|
|
5
13
|
- [2.26.1] Bug fix in ```model.createRecord()```
|