yucky-goldY
Refine4y ago
2 replies
yucky-gold

Incorrect redirect behavior?

Refine app utilizing Mantine.

I have resources within App.tsx defined as,
{
  name: 'directory',
  options: {
    label: "DIRECTORY"
  },
  icon: <></>
},
{
  parentName: "directory",
  name: "users",
  options: {
      label: 'USERS'
  },
  list: UserList,
  edit: UserEdit,
  create: UserCreate
},
...


have an edit view that uses the 'useForm' hook and manually specifying the resource,
const {
    saveButtonProps,
    refineCore: { queryResult, onFinish, formLoading, redirect },
    getInputProps,
    values,
} = useForm< HttpError>({
    refineCoreProps: {
        resource: 'user',
        id,
        metaData: {
            fields
        },
    },
    initialValues: filteredInitialValues,
});

Navigate to list view at 'directory/user', click edit or create button to navigate to another view, submit the form for that view, but the navigation goes back to 'user' instead of 'directory/user'. How would I specify the 'directory/user' resource to navigate to after a successful mutation?
Was this page helpful?