mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 09:47:10 +00:00
fix(collection-manager): remove __parent
This commit is contained in:
parent
2f66334996
commit
01294d3c83
@ -1,8 +1,8 @@
|
||||
import { ArrayTable } from '@formily/antd';
|
||||
import { ISchema, useForm } from '@formily/react';
|
||||
import { uid } from '@formily/shared';
|
||||
import { omit } from 'lodash';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
import omit from 'lodash/omit';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useRequest } from '../../api-client';
|
||||
@ -78,10 +78,13 @@ const getSchema = (schema: IField, record: any, compile, getContainer): ISchema
|
||||
|
||||
export const useValuesFromRecord = (options) => {
|
||||
const record = useRecord();
|
||||
const result = useRequest(() => Promise.resolve({ data: { autoGenId: true, ...record,category:record?.category.map((v)=>v.id) } }), {
|
||||
...options,
|
||||
manual: true,
|
||||
});
|
||||
const result = useRequest(
|
||||
() => Promise.resolve({ data: { ...omit(record, ['__parent']), category: record?.category.map((v) => v.id) } }),
|
||||
{
|
||||
...options,
|
||||
manual: true,
|
||||
},
|
||||
);
|
||||
const ctx = useActionContext();
|
||||
useEffect(() => {
|
||||
if (ctx.visible) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { useField, useForm } from '@formily/react';
|
||||
import { message } from 'antd';
|
||||
import omit from 'lodash/omit';
|
||||
import { useEffect } from 'react';
|
||||
import { useCollection, useCollectionManager } from '.';
|
||||
import { useRequest } from '../api-client';
|
||||
@ -21,7 +22,7 @@ export const useCancelAction = () => {
|
||||
|
||||
export const useValuesFromRecord = (options) => {
|
||||
const record = useRecord();
|
||||
const result = useRequest(() => Promise.resolve({ data: record }), {
|
||||
const result = useRequest(() => Promise.resolve({ data: omit(record, ['__parent']) }), {
|
||||
...options,
|
||||
manual: true,
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user