R
Refine

ask-any-question

useform attach initialfilter strapi v4

Qquickest-silver3/8/2023
} = useForm({

refineCoreProps: {
mutationMode: "pessimistic",
//config: {
//filters: [{ field: "variable][id]", operator: "eq", value: selectedVariable }],
// },
}
});
} = useForm({

refineCoreProps: {
mutationMode: "pessimistic",
//config: {
//filters: [{ field: "variable][id]", operator: "eq", value: selectedVariable }],
// },
}
});
how can i attach filter in useform for edit? it works in useList.
Kkapa.ai3/8/2023
Hey @.yoda.! I'm the kapa.ai support bot. I've searched through the docs to try to answer your question. :wave:
Kkapa.ai3/8/2023
---------------------- In edit mode, you can pass queryOptions (https://tanstack.com/query/v4/docs/react/reference/useQuery) options to useForm by passing queryOptions property. For example, if you want to attach a filter to useForm in edit mode, you can do the following:
useForm({
queryOptions: {
retry: 3,
filters: [{ field: "variable][id]", operator: "eq", value: selectedVariable }],
},
});
useForm({
queryOptions: {
retry: 3,
filters: [{ field: "variable][id]", operator: "eq", value: selectedVariable }],
},
});
For more information, please refer to the refine documentation (https://refine.dev/docs/api-reference/core/hooks/useForm). ----------------------
Kkapa.ai3/8/2023
Did kapa.ai help answer your question?
<@271294719559073792> kapa.ai is still learning and improving, please let us how it did by reacting with a :thumbsup: or :thumbsdown:
Qquickest-silver3/8/2023
Bots answer did not work
Jjolly-crimson3/8/2023
Hello @.yoda. since edit is related to single resource, I'm not sure if you should have filter on useForm.
Qquickest-silver3/9/2023
@batuhanw thanks for the quick answer. since i am working with strapi in the backend i try to send some extra information to the backend to check some logic. is there a way i can attach this extra information to the useForm?
Jjolly-crimson3/10/2023
Hello @.yoda., you can use metaData field to pass extra fields to your data provider: https://refine.dev/docs/packages/documentation/react-hook-form/useForm/#metadata
useForm | refine
The @pankod/refine-react-hook-form adapter allows you to integrate the React Hook Form library with refine, enabling you to manage your forms in a headless manner. This adapter supports all of the features of both React Hook Form and refine's useForm hook, and you can use any of the React Hook Form examples as-is by copying and pasting them into...
Qquickest-silver3/10/2023
Thanks a lot 👍

Looking for more? Join the community!

R
Refine

ask-any-question

Join Server
Recommended Posts
getting startedhow should I get started with refine.dev?Display only certain rows in List view MuiHello everyone !! I have a user ressources in which i have all users (admin and non admin) and need [antd] using filterDropdown and RangePicker to filter date in a range of datesHi, I'm having some trouble filtering data using `<DatePicker.RangePicker>` and `<Filterdorpdown>` fant-modal-wrap background color in useModalI'm using useModal in my project "@pankod/refine-antd": "^4.7.3" Why the modal's background is totaAn error occured while creating git commit.Hello, I'm very new to this and I apologise for my cluelessness but I'm getting this error every timcustom messsage on event notificationHi everyone, i am currently working on permission on my refine app. I allow only admin user to loginedithi all I face issue on updating an item in DB I want to edit on item by opening a new page spaceficlAntd auto complete for text inputsHi does refine support Antd auto complete for text inputs like https://ant.design/components/auto-coCan MUI Inferencer infer form fields for nested objects?I have a number of structures I'm hoping to use the inferencer to stub out create forms for, but so Refine Google Auth Login ProblemI changed the id in the login.tsx but I still get this.Error which running development serverGetting the error while running the development server. It runs fine for 2-3 mins ,then abruptly stHello everyone I m using a customtoolbarHello everyone. I'm using a customtoolbar passed as a components prop in my datagrid. Is there any vscode edge devtools Code bypass authoSo I use vscode edge devtools Code with in VsCode so trying to find out away to bypass autho to I causeSelect() hook usehi all I wounder what is suppose to be the backend section here: https://refine.dev/docs/tutorial/adVery big bundle size with the getting started projectCreating an ant-d project npm create refine-app@latest with demo example pages. The JS bundle is 5MBHow to add menu item for a custom pageIs there any way to add menu item for a custom page? As far as I know useMenu is only using resourcedelete item by id using useDelete()hi all Iam trying to delete a specific item from the DB by ID the steps like that: 1) we have a dataDataGrid and SSRHello, I'm trying to use SSR in my project, I'm using next with MUI, I've already configured everyth