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