dobo 2.6.0 → 2.6.2
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/collect-models.js +1 -2
- package/lib/factory/model/_util.js +5 -4
- package/package.json +1 -1
- package/wiki/CHANGES.md +5 -1
package/lib/collect-models.js
CHANGED
|
@@ -203,8 +203,6 @@ export async function sanitizeAll (model) {
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
await runHook(`dobo.${camelCase(model.name)}:afterSanitizeModel`, model)
|
|
206
|
-
// fields that can participate in table scan if needed
|
|
207
|
-
model.scans = []
|
|
208
206
|
// sorting only possible using these fields
|
|
209
207
|
model.sortables = []
|
|
210
208
|
for (const index of model.indexes) {
|
|
@@ -239,6 +237,7 @@ async function createSchema (item) {
|
|
|
239
237
|
item.connection = null
|
|
240
238
|
item.hooks = item.hooks ?? []
|
|
241
239
|
item.disabled = item.disabled ?? []
|
|
240
|
+
item.scanables = item.scanables ?? []
|
|
242
241
|
if (item.disabled === 'all') item.disabled = ['find', 'get', 'create', 'update', 'remove']
|
|
243
242
|
else if (item.disabled === 'readonly') item.disabled = ['create', 'update', 'remove']
|
|
244
243
|
// Is there any overwritten connection?
|
|
@@ -63,7 +63,8 @@ export async function getFilterAndOptions (filter = {}, options = {}, action) {
|
|
|
63
63
|
for (const key of keys) {
|
|
64
64
|
nOptions[key] = options[key]
|
|
65
65
|
}
|
|
66
|
-
|
|
66
|
+
nFilter.orgQuery = nFilter.query
|
|
67
|
+
nFilter.orgSearch = nFilter.search
|
|
67
68
|
if (!nOptions.noModelHook) await runModelHook(this, 'beforeBuildQuery', nFilter.query, nOptions)
|
|
68
69
|
nFilter.query = buildFilterQuery.call(this, nFilter) ?? {}
|
|
69
70
|
if (!nOptions.noModelHook) await runModelHook(this, 'afterBuildQuery', nFilter.query, nOptions)
|
|
@@ -237,9 +238,9 @@ export function buildFilterQuery (filter = {}) {
|
|
|
237
238
|
filter.search = q
|
|
238
239
|
return {} //
|
|
239
240
|
} else {
|
|
240
|
-
let
|
|
241
|
-
if (
|
|
242
|
-
const fields =
|
|
241
|
+
let scanables = [...this.scanables]
|
|
242
|
+
if (scanables.length === 0) scanables = [...this.sortables]
|
|
243
|
+
const fields = scanables.filter(f => {
|
|
243
244
|
const field = find(this.properties, { name: f, type: 'string' })
|
|
244
245
|
return !!field
|
|
245
246
|
})
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-02-02
|
|
4
|
+
|
|
5
|
+
- [2.6.2] Bug fix on query & search resolver: Do not remove old query/search, should always copied to oldQuery/oldSearch
|
|
6
|
+
|
|
3
7
|
## 2026-02-01
|
|
4
8
|
|
|
5
|
-
- [2.6.0] Add ```model.
|
|
9
|
+
- [2.6.0] Add ```model.scanables``` for fields that can participate in table scans if necessary
|
|
6
10
|
- [2.6.0] Add ```driver.support.search``` for driver's fulltext search support
|
|
7
11
|
- [2.6.0] Add model hooks ```before/afterBuildQuery/Search```
|
|
8
12
|
|