Correcting foreign key short comings
This commit is contained in:
@@ -60,7 +60,7 @@ const RealAutocomplete = <T = any, S extends ForeignKeySchema = ForeignKeySchema
|
||||
const { data, isLoading } = useList({
|
||||
resource: `${basePath}/${resource}`,
|
||||
pagination: { current: 1, pageSize: 10, mode: "server" },
|
||||
filters: [{ field: "label", operator: "contains", value: debouncedInputValue }],
|
||||
filters: [{ field: "search", operator: "contains", value: debouncedInputValue }],
|
||||
sorters: [{ field: "label", order: "asc" }],
|
||||
});
|
||||
|
||||
@@ -110,7 +110,7 @@ const RealAutocomplete = <T = any, S extends ForeignKeySchema = ForeignKeySchema
|
||||
uiSchema={{}}
|
||||
onSuccess={(data: any) => {
|
||||
setOpenFormModal(false)
|
||||
onChange(data.data.id);
|
||||
onChange(data.id);
|
||||
}}
|
||||
/>
|
||||
</DialogContent>
|
||||
@@ -233,7 +233,8 @@ const FormContainerNew = (props: FormContainerProps) => {
|
||||
const { schemaName, resourceBasePath, resource, uiSchema = {}, onSuccess } = props;
|
||||
const { onFinish } = useForm({
|
||||
resource: `${resourceBasePath}/${resource}`,
|
||||
action: "create"
|
||||
action: "create",
|
||||
onMutationSuccess: data => onSuccess(data.data)
|
||||
});
|
||||
|
||||
return (
|
||||
@@ -242,10 +243,8 @@ const FormContainerNew = (props: FormContainerProps) => {
|
||||
schemaName={schemaName}
|
||||
uiSchema={uiSchema}
|
||||
resourceBasePath={resourceBasePath}
|
||||
onSubmit={(data:any) => {
|
||||
onFinish(data);
|
||||
onSuccess(data);
|
||||
}} />
|
||||
onSubmit={(data:any) => { onFinish(data);}}
|
||||
/>
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user