oak-domain 5.1.2 → 5.1.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.
|
@@ -79,7 +79,7 @@ function createUniqueCheckers(schema) {
|
|
|
79
79
|
entity,
|
|
80
80
|
action: 'create',
|
|
81
81
|
type: 'logicalData',
|
|
82
|
-
priority: types_1.CHECKER_MAX_PRIORITY,
|
|
82
|
+
priority: types_1.CHECKER_MAX_PRIORITY, // 优先级要放在最低,所有前置的checker/trigger将数据完整之后再在这里检测
|
|
83
83
|
checker: (operation, context) => {
|
|
84
84
|
const { data } = operation;
|
|
85
85
|
if (data instanceof Array) {
|
|
@@ -95,9 +95,9 @@ function createUniqueCheckers(schema) {
|
|
|
95
95
|
}
|
|
96
96
|
}, {
|
|
97
97
|
entity,
|
|
98
|
-
action: 'update',
|
|
98
|
+
action: 'update', // 只检查update,其它状态转换的action应该不会涉及unique约束的属性
|
|
99
99
|
type: 'logicalData',
|
|
100
|
-
priority: types_1.CHECKER_MAX_PRIORITY,
|
|
100
|
+
priority: types_1.CHECKER_MAX_PRIORITY, // 优先级要放在最低,所有前置的checker/trigger将数据完整之后再在这里检测
|
|
101
101
|
checker: (operation, context) => {
|
|
102
102
|
const { data, filter: operationFilter } = operation;
|
|
103
103
|
if (data) {
|
|
@@ -227,7 +227,7 @@ function createActionTransformerCheckers(actionDefDict) {
|
|
|
227
227
|
action: 'create',
|
|
228
228
|
type: 'logical',
|
|
229
229
|
entity,
|
|
230
|
-
priority: 10,
|
|
230
|
+
priority: 10, // 优先级要高,先于真正的data检查进行
|
|
231
231
|
checker: (operation) => {
|
|
232
232
|
const { data } = operation;
|
|
233
233
|
if (data instanceof Array) {
|
package/lib/types/Sync.d.ts
CHANGED
package/lib/utils/assert.d.ts
CHANGED
|
@@ -60,7 +60,7 @@ function destructRelationPath(schema, entity, path, relationFilter, recursive) {
|
|
|
60
60
|
},
|
|
61
61
|
filter: relationFilter,
|
|
62
62
|
} // as ED['userRelation']['Selection']
|
|
63
|
-
},
|
|
63
|
+
}, // as ED[keyof ED]['Selection']['data'],
|
|
64
64
|
getData: (d) => {
|
|
65
65
|
return d.userRelation$entity;
|
|
66
66
|
},
|