@airoom/nextmin-react 0.1.6 → 0.1.7
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.
|
@@ -245,7 +245,7 @@ export function SchemaForm({ model, schemaOverride, initialValues, submitLabel =
|
|
|
245
245
|
const fields = useMemo(() => Object.entries(schema.attributes)
|
|
246
246
|
.filter(([name]) => !AUDIT_FIELDS.has(name))
|
|
247
247
|
// Force-hide any linkage field named "baseId"
|
|
248
|
-
.filter(([name]) => name !== 'baseId')
|
|
248
|
+
.filter(([name]) => name !== 'baseId' && name !== 'exId')
|
|
249
249
|
.filter(([, attr]) => canBypassPrivacy ? true : !attr?.private)
|
|
250
250
|
.filter(([, attr]) => !isHiddenAttr(attr, isEdit))
|
|
251
251
|
.filter(([name, attr]) => !(isEdit && isPasswordAttr(name, attr)))
|
|
@@ -256,7 +256,7 @@ export function SchemaForm({ model, schemaOverride, initialValues, submitLabel =
|
|
|
256
256
|
e.preventDefault();
|
|
257
257
|
setError(undefined);
|
|
258
258
|
try {
|
|
259
|
-
const { createdAt, updatedAt, ...payload } = form;
|
|
259
|
+
const { createdAt, updatedAt, baseId, exId, __childId, ...payload } = form;
|
|
260
260
|
await onSubmit(payload);
|
|
261
261
|
}
|
|
262
262
|
catch (err) {
|
|
@@ -531,19 +531,18 @@ function normalizeIdsArray(raw) {
|
|
|
531
531
|
if (!raw)
|
|
532
532
|
return [];
|
|
533
533
|
if (Array.isArray(raw)) {
|
|
534
|
-
return raw
|
|
535
|
-
.map((v) => {
|
|
534
|
+
return raw.map((v) => {
|
|
536
535
|
if (typeof v === 'string')
|
|
537
536
|
return v;
|
|
538
537
|
if (v && typeof v === 'object') {
|
|
539
538
|
const anyv = v;
|
|
540
539
|
return ((typeof anyv.id === 'string' && anyv.id) ||
|
|
541
540
|
(typeof anyv._id === 'string' && anyv._id) ||
|
|
541
|
+
(typeof anyv.exId === 'string' && anyv.exId) ||
|
|
542
542
|
null);
|
|
543
543
|
}
|
|
544
544
|
return null;
|
|
545
|
-
})
|
|
546
|
-
.filter((x) => !!x);
|
|
545
|
+
});
|
|
547
546
|
}
|
|
548
547
|
return [];
|
|
549
548
|
}
|
|
@@ -556,6 +555,7 @@ function normalizeId(raw) {
|
|
|
556
555
|
const anyv = raw;
|
|
557
556
|
const id = (typeof anyv.id === 'string' && anyv.id) ||
|
|
558
557
|
(typeof anyv._id === 'string' && anyv._id) ||
|
|
558
|
+
(typeof anyv.exId === 'string' && anyv.exId) ||
|
|
559
559
|
null;
|
|
560
560
|
return id;
|
|
561
561
|
}
|