notNull检查时处理null属性
This commit is contained in:
parent
158f21e706
commit
6b9aabec7c
|
|
@ -426,7 +426,7 @@ function createCreateCheckers(schema) {
|
|||
action: 'create',
|
||||
checker: (data) => {
|
||||
const checkData = (data2) => {
|
||||
const illegalNullAttrs = (0, lodash_1.difference)(notNullAttrs, Object.keys(data2));
|
||||
const illegalNullAttrs = (0, lodash_1.difference)(notNullAttrs, Object.keys(data2).filter(ele => data2[ele] !== null));
|
||||
if (illegalNullAttrs.length > 0) {
|
||||
const emtpyAttrs = [];
|
||||
// 要处理多对一的cascade create
|
||||
|
|
|
|||
|
|
@ -476,7 +476,7 @@ export function createCreateCheckers<ED extends EntityDict & BaseEntityDict, Cxt
|
|||
action: 'create' as ED[keyof ED]['Action'],
|
||||
checker: (data) => {
|
||||
const checkData = (data2: ED[keyof ED]['CreateSingle']['data']) => {
|
||||
const illegalNullAttrs = difference(notNullAttrs, Object.keys(data2));
|
||||
const illegalNullAttrs = difference(notNullAttrs, Object.keys(data2).filter(ele => data2[ele] !== null));
|
||||
if (illegalNullAttrs.length > 0) {
|
||||
const emtpyAttrs: string[] = [];
|
||||
// 要处理多对一的cascade create
|
||||
|
|
|
|||
Loading…
Reference in New Issue