diff --git a/examples/access-control-casbin/src/pages/posts/edit.tsx b/examples/access-control-casbin/src/pages/posts/edit.tsx index a7ac2428084d..d160dc4d3a62 100644 --- a/examples/access-control-casbin/src/pages/posts/edit.tsx +++ b/examples/access-control-casbin/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/access-control-cerbos/src/pages/posts/edit.tsx b/examples/access-control-cerbos/src/pages/posts/edit.tsx index a7ac2428084d..d160dc4d3a62 100644 --- a/examples/access-control-cerbos/src/pages/posts/edit.tsx +++ b/examples/access-control-cerbos/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/access-control-permify/src/pages/posts/edit.tsx b/examples/access-control-permify/src/pages/posts/edit.tsx index 8d66194f97b3..0178abcb87f3 100644 --- a/examples/access-control-permify/src/pages/posts/edit.tsx +++ b/examples/access-control-permify/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/app-crm-minimal/src/components/layout/account-settings/index.tsx b/examples/app-crm-minimal/src/components/layout/account-settings/index.tsx index 5401c999ec65..6a3455bdd1d1 100644 --- a/examples/app-crm-minimal/src/components/layout/account-settings/index.tsx +++ b/examples/app-crm-minimal/src/components/layout/account-settings/index.tsx @@ -22,7 +22,11 @@ type Props = { }; export const AccountSettings = ({ opened, setOpened, userId }: Props) => { - const { saveButtonProps, formProps, queryResult } = useForm< + const { + saveButtonProps, + formProps, + query: queryResult, + } = useForm< GetFields, HttpError, GetVariables diff --git a/examples/app-crm-minimal/src/routes/companies/edit/form.tsx b/examples/app-crm-minimal/src/routes/companies/edit/form.tsx index 23c9f3c126a4..55b1836d17f6 100644 --- a/examples/app-crm-minimal/src/routes/companies/edit/form.tsx +++ b/examples/app-crm-minimal/src/routes/companies/edit/form.tsx @@ -25,7 +25,12 @@ import { getNameInitials } from "@/utilities"; import { UPDATE_COMPANY_MUTATION } from "./queries"; export const CompanyForm = () => { - const { saveButtonProps, formProps, formLoading, queryResult } = useForm< + const { + saveButtonProps, + formProps, + formLoading, + query: queryResult, + } = useForm< GetFields, HttpError, GetVariables diff --git a/examples/app-crm/src/routes/calendar/edit.tsx b/examples/app-crm/src/routes/calendar/edit.tsx index 8434c0631c5d..ad36fc13663f 100644 --- a/examples/app-crm/src/routes/calendar/edit.tsx +++ b/examples/app-crm/src/routes/calendar/edit.tsx @@ -18,17 +18,22 @@ export const CalendarEditPage: React.FC = () => { const { id } = useResource(); const { list } = useNavigation(); - const { formProps, saveButtonProps, form, onFinish, queryResult } = - useForm({ - action: "edit", - id, - queryOptions: { - enabled: true, - }, - meta: { - gqlMutation: CALENDAR_UPDATE_EVENT_MUTATION, - }, - }); + const { + formProps, + saveButtonProps, + form, + onFinish, + query: queryResult, + } = useForm({ + action: "edit", + id, + queryOptions: { + enabled: true, + }, + meta: { + gqlMutation: CALENDAR_UPDATE_EVENT_MUTATION, + }, + }); useEffect(() => { const startDate = queryResult?.data?.data.startDate; diff --git a/examples/app-crm/src/routes/companies/components/title-form/title-form.tsx b/examples/app-crm/src/routes/companies/components/title-form/title-form.tsx index a54303e97d85..0d9200e1142d 100644 --- a/examples/app-crm/src/routes/companies/components/title-form/title-form.tsx +++ b/examples/app-crm/src/routes/companies/components/title-form/title-form.tsx @@ -20,7 +20,11 @@ import { COMPANY_TITLE_FORM_MUTATION, COMPANY_TITLE_QUERY } from "./queries"; import styles from "./title-form.module.css"; export const CompanyTitleForm = () => { - const { formProps, queryResult, onFinish } = useForm< + const { + formProps, + query: queryResult, + onFinish, + } = useForm< GetFields, HttpError, GetVariables diff --git a/examples/app-crm/src/routes/quotes/components/products-services.tsx b/examples/app-crm/src/routes/quotes/components/products-services.tsx index 375c423afb89..59737bd890cf 100644 --- a/examples/app-crm/src/routes/quotes/components/products-services.tsx +++ b/examples/app-crm/src/routes/quotes/components/products-services.tsx @@ -116,7 +116,11 @@ const columns = [ export const ProductsServices = () => { const params = useParams<{ id: string }>(); - const { formProps, autoSaveProps, queryResult } = useForm< + const { + formProps, + autoSaveProps, + query: queryResult, + } = useForm< GetFields, HttpError, GetVariables @@ -415,7 +419,7 @@ const TaxForm = (props: { }) => { const params = useParams<{ id: string }>(); - const { formProps, queryResult } = useForm< + const { formProps, query: queryResult } = useForm< Quote, HttpError, QuoteUpdateInput diff --git a/examples/app-crm/src/routes/quotes/components/show-description.tsx b/examples/app-crm/src/routes/quotes/components/show-description.tsx index e64ab70739b2..2150706cda3c 100644 --- a/examples/app-crm/src/routes/quotes/components/show-description.tsx +++ b/examples/app-crm/src/routes/quotes/components/show-description.tsx @@ -15,11 +15,11 @@ const MDEditor = lazy(() => import("@uiw/react-md-editor")); export const ShowDescription = () => { const params = useParams<{ id: string }>(); - const { formProps, queryResult, autoSaveProps } = useForm< - Quote, - HttpError, - QuoteUpdateInput - >({ + const { + formProps, + query: queryResult, + autoSaveProps, + } = useForm({ resource: "quotes", action: "edit", id: params.id, diff --git a/examples/audit-log-provider/src/pages/posts/edit.tsx b/examples/audit-log-provider/src/pages/posts/edit.tsx index 07c74961d301..b12ab2b10010 100644 --- a/examples/audit-log-provider/src/pages/posts/edit.tsx +++ b/examples/audit-log-provider/src/pages/posts/edit.tsx @@ -10,7 +10,7 @@ export const PostEdit: React.FC = () => { const { resourceName, id } = useResource(); const { - refineCore: { onFinish, formLoading, queryResult }, + refineCore: { onFinish, formLoading, query: queryResult }, register, handleSubmit, resetField, diff --git a/examples/auth-antd/src/pages/posts/edit.tsx b/examples/auth-antd/src/pages/posts/edit.tsx index a7ac2428084d..d160dc4d3a62 100644 --- a/examples/auth-antd/src/pages/posts/edit.tsx +++ b/examples/auth-antd/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/auth-auth0/src/pages/posts/edit.tsx b/examples/auth-auth0/src/pages/posts/edit.tsx index a7ac2428084d..d160dc4d3a62 100644 --- a/examples/auth-auth0/src/pages/posts/edit.tsx +++ b/examples/auth-auth0/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/auth-chakra-ui/src/pages/posts/edit.tsx b/examples/auth-chakra-ui/src/pages/posts/edit.tsx index 8d5596c118c3..8a72ceaf6f0c 100644 --- a/examples/auth-chakra-ui/src/pages/posts/edit.tsx +++ b/examples/auth-chakra-ui/src/pages/posts/edit.tsx @@ -14,7 +14,7 @@ import type { IPost } from "../../interfaces"; export const PostEdit = () => { const { - refineCore: { formLoading, queryResult }, + refineCore: { formLoading, query: queryResult }, saveButtonProps, register, formState: { errors }, diff --git a/examples/auth-google-login/src/pages/posts/edit.tsx b/examples/auth-google-login/src/pages/posts/edit.tsx index a7ac2428084d..d160dc4d3a62 100644 --- a/examples/auth-google-login/src/pages/posts/edit.tsx +++ b/examples/auth-google-login/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/auth-headless/src/pages/posts/edit.tsx b/examples/auth-headless/src/pages/posts/edit.tsx index bda14afb70d7..eceb19d84a2a 100644 --- a/examples/auth-headless/src/pages/posts/edit.tsx +++ b/examples/auth-headless/src/pages/posts/edit.tsx @@ -4,7 +4,7 @@ import { useSelect } from "@refinedev/core"; export const PostEdit: React.FC = () => { const { - refineCore: { onFinish, formLoading, queryResult }, + refineCore: { onFinish, formLoading, query: queryResult }, register, handleSubmit, resetField, diff --git a/examples/auth-keycloak/src/pages/posts/edit.tsx b/examples/auth-keycloak/src/pages/posts/edit.tsx index a7ac2428084d..d160dc4d3a62 100644 --- a/examples/auth-keycloak/src/pages/posts/edit.tsx +++ b/examples/auth-keycloak/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/auth-mantine/src/pages/posts/edit.tsx b/examples/auth-mantine/src/pages/posts/edit.tsx index 909fc47d41bd..be76d29bae6c 100644 --- a/examples/auth-mantine/src/pages/posts/edit.tsx +++ b/examples/auth-mantine/src/pages/posts/edit.tsx @@ -8,7 +8,7 @@ export const PostEdit: React.FC = () => { const { saveButtonProps, getInputProps, - refineCore: { queryResult }, + refineCore: { query: queryResult }, errors, } = useForm({ initialValues: { diff --git a/examples/auth-material-ui/src/pages/posts/edit.tsx b/examples/auth-material-ui/src/pages/posts/edit.tsx index 0d36a26b115c..247398df8af5 100644 --- a/examples/auth-material-ui/src/pages/posts/edit.tsx +++ b/examples/auth-material-ui/src/pages/posts/edit.tsx @@ -12,7 +12,7 @@ import type { IPost, ICategory, IStatus, Nullable } from "../../interfaces"; export const PostEdit: React.FC = () => { const { saveButtonProps, - refineCore: { queryResult }, + refineCore: { query: queryResult }, register, control, formState: { errors }, diff --git a/examples/auth-otp/src/pages/posts/edit.tsx b/examples/auth-otp/src/pages/posts/edit.tsx index a7ac2428084d..d160dc4d3a62 100644 --- a/examples/auth-otp/src/pages/posts/edit.tsx +++ b/examples/auth-otp/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/base-antd/src/pages/posts/edit.tsx b/examples/base-antd/src/pages/posts/edit.tsx index 9061a282576a..13392b62e9c2 100644 --- a/examples/base-antd/src/pages/posts/edit.tsx +++ b/examples/base-antd/src/pages/posts/edit.tsx @@ -8,13 +8,17 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult, autoSaveProps } = - useForm({ - warnWhenUnsavedChanges: true, - autoSave: { - enabled: true, - }, - }); + const { + formProps, + saveButtonProps, + query: queryResult, + autoSaveProps, + } = useForm({ + warnWhenUnsavedChanges: true, + autoSave: { + enabled: true, + }, + }); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/base-chakra-ui/src/pages/posts/edit.tsx b/examples/base-chakra-ui/src/pages/posts/edit.tsx index cfd2ad214f24..ab937c62c34a 100644 --- a/examples/base-chakra-ui/src/pages/posts/edit.tsx +++ b/examples/base-chakra-ui/src/pages/posts/edit.tsx @@ -15,7 +15,7 @@ import type { IPost } from "../../interfaces"; export const PostEdit = () => { const { - refineCore: { formLoading, queryResult, autoSaveProps }, + refineCore: { formLoading, query: queryResult, autoSaveProps }, saveButtonProps, register, formState: { errors }, diff --git a/examples/base-headless/src/pages/posts/edit.tsx b/examples/base-headless/src/pages/posts/edit.tsx index bda14afb70d7..eceb19d84a2a 100644 --- a/examples/base-headless/src/pages/posts/edit.tsx +++ b/examples/base-headless/src/pages/posts/edit.tsx @@ -4,7 +4,7 @@ import { useSelect } from "@refinedev/core"; export const PostEdit: React.FC = () => { const { - refineCore: { onFinish, formLoading, queryResult }, + refineCore: { onFinish, formLoading, query: queryResult }, register, handleSubmit, resetField, diff --git a/examples/base-mantine/src/pages/posts/edit.tsx b/examples/base-mantine/src/pages/posts/edit.tsx index cf821d2b6e40..01b48a8f7050 100644 --- a/examples/base-mantine/src/pages/posts/edit.tsx +++ b/examples/base-mantine/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ export const PostEdit: React.FC = () => { saveButtonProps, getInputProps, errors, - refineCore: { queryResult, autoSaveProps }, + refineCore: { query: queryResult, autoSaveProps }, } = useForm({ initialValues: { title: "", diff --git a/examples/base-material-ui/src/pages/posts/edit.tsx b/examples/base-material-ui/src/pages/posts/edit.tsx index 9a49279331b6..da1fc8a48986 100644 --- a/examples/base-material-ui/src/pages/posts/edit.tsx +++ b/examples/base-material-ui/src/pages/posts/edit.tsx @@ -12,7 +12,7 @@ import type { IPost, ICategory, Nullable, IStatus } from "../../interfaces"; export const PostEdit: React.FC = () => { const { saveButtonProps, - refineCore: { queryResult, autoSaveProps }, + refineCore: { query: queryResult, autoSaveProps }, register, control, formState: { errors }, diff --git a/examples/blog-invoice-generator/src/pages/contacts/edit.tsx b/examples/blog-invoice-generator/src/pages/contacts/edit.tsx index 580146675eea..e0880275a925 100644 --- a/examples/blog-invoice-generator/src/pages/contacts/edit.tsx +++ b/examples/blog-invoice-generator/src/pages/contacts/edit.tsx @@ -5,7 +5,11 @@ import { Form, Select, Input } from "antd"; import type { IContact } from "interfaces"; export const ContactEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm({ + const { + formProps, + saveButtonProps, + query: queryResult, + } = useForm({ metaData: { populate: ["client"] }, }); diff --git a/examples/blog-invoice-generator/src/pages/invoice/edit.tsx b/examples/blog-invoice-generator/src/pages/invoice/edit.tsx index 9e402a9ee343..25c55b10e359 100644 --- a/examples/blog-invoice-generator/src/pages/invoice/edit.tsx +++ b/examples/blog-invoice-generator/src/pages/invoice/edit.tsx @@ -5,7 +5,11 @@ import { Form, Input, Select } from "antd"; import type { IInvoice } from "interfaces"; export const InvoiceEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm({ + const { + formProps, + saveButtonProps, + query: queryResult, + } = useForm({ metaData: { populate: ["company", "contact", "missions"] }, }); diff --git a/examples/blog-material-ui/src/pages/posts/edit.tsx b/examples/blog-material-ui/src/pages/posts/edit.tsx index d76a37db722e..757843843661 100644 --- a/examples/blog-material-ui/src/pages/posts/edit.tsx +++ b/examples/blog-material-ui/src/pages/posts/edit.tsx @@ -11,7 +11,7 @@ import type { IPost, ICategory, Nullable } from "interfaces"; export const PostEdit: React.FC = () => { const { - refineCore: { formLoading, queryResult }, + refineCore: { formLoading, query: queryResult }, saveButtonProps, register, control, diff --git a/examples/blog-ra-chakra-tutorial/src/pages/posts/create.tsx b/examples/blog-ra-chakra-tutorial/src/pages/posts/create.tsx index 638871e736ee..c8807b8ebc80 100644 --- a/examples/blog-ra-chakra-tutorial/src/pages/posts/create.tsx +++ b/examples/blog-ra-chakra-tutorial/src/pages/posts/create.tsx @@ -13,7 +13,7 @@ import { useForm } from "@refinedev/react-hook-form"; export const PostCreate = () => { const { - refineCore: { formLoading, queryResult }, + refineCore: { formLoading, query: queryResult }, saveButtonProps, register, resetField, diff --git a/examples/blog-ra-chakra-tutorial/src/pages/posts/edit.tsx b/examples/blog-ra-chakra-tutorial/src/pages/posts/edit.tsx index 33c4901d2d42..db81ee210910 100644 --- a/examples/blog-ra-chakra-tutorial/src/pages/posts/edit.tsx +++ b/examples/blog-ra-chakra-tutorial/src/pages/posts/edit.tsx @@ -12,7 +12,7 @@ import { useSelect } from "@refinedev/core"; export const PostEdit = () => { const { - refineCore: { formLoading, queryResult }, + refineCore: { formLoading, query: queryResult }, saveButtonProps, register, setValue, diff --git a/examples/blog-react-dnd/src/pages/posts/edit.tsx b/examples/blog-react-dnd/src/pages/posts/edit.tsx index f824a86f7a06..7b709733ec81 100644 --- a/examples/blog-react-dnd/src/pages/posts/edit.tsx +++ b/examples/blog-react-dnd/src/pages/posts/edit.tsx @@ -6,7 +6,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost } from "interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const { selectProps: categorySelectProps } = useSelect({ resource: "categories", diff --git a/examples/blog-refine-airtable-crud/src/pages/post/create.tsx b/examples/blog-refine-airtable-crud/src/pages/post/create.tsx index 41eb3d123357..8d907256aa54 100644 --- a/examples/blog-refine-airtable-crud/src/pages/post/create.tsx +++ b/examples/blog-refine-airtable-crud/src/pages/post/create.tsx @@ -4,7 +4,7 @@ import React from "react"; export const PostCreate: React.FC = () => { const { - refineCore: { onFinish, formLoading, queryResult }, + refineCore: { onFinish, formLoading, query: queryResult }, register, handleSubmit, formState: { errors }, diff --git a/examples/blog-refine-airtable-crud/src/pages/post/edit.tsx b/examples/blog-refine-airtable-crud/src/pages/post/edit.tsx index 6c3768ad6c22..9522e66cb4a1 100644 --- a/examples/blog-refine-airtable-crud/src/pages/post/edit.tsx +++ b/examples/blog-refine-airtable-crud/src/pages/post/edit.tsx @@ -4,7 +4,7 @@ import React, { useEffect } from "react"; export const PostEdit: React.FC = () => { const { - refineCore: { onFinish, formLoading, queryResult }, + refineCore: { onFinish, formLoading, query: queryResult }, register, handleSubmit, resetField, diff --git a/examples/blog-refine-daisyui/src/pages/categories/edit.tsx b/examples/blog-refine-daisyui/src/pages/categories/edit.tsx index a17a9af142f6..c9bc36cd1fff 100644 --- a/examples/blog-refine-daisyui/src/pages/categories/edit.tsx +++ b/examples/blog-refine-daisyui/src/pages/categories/edit.tsx @@ -7,7 +7,7 @@ export const CategoryEdit = () => { const { list } = useNavigation(); const { - refineCore: { onFinish, queryResult }, + refineCore: { onFinish, query: queryResult }, register, handleSubmit, formState: { errors }, diff --git a/examples/blog-refine-daisyui/src/pages/products/edit.tsx b/examples/blog-refine-daisyui/src/pages/products/edit.tsx index 1c90201222cf..8d81a7d37cec 100644 --- a/examples/blog-refine-daisyui/src/pages/products/edit.tsx +++ b/examples/blog-refine-daisyui/src/pages/products/edit.tsx @@ -7,7 +7,7 @@ export const ProductEdit = () => { const { list } = useNavigation(); const { - refineCore: { onFinish, queryResult }, + refineCore: { onFinish, query: queryResult }, register, handleSubmit, setValue, diff --git a/examples/blog-refine-mantine-strapi/src/pages/posts/edit.tsx b/examples/blog-refine-mantine-strapi/src/pages/posts/edit.tsx index f28cffd91a12..b6a4a22d48c3 100644 --- a/examples/blog-refine-mantine-strapi/src/pages/posts/edit.tsx +++ b/examples/blog-refine-mantine-strapi/src/pages/posts/edit.tsx @@ -7,7 +7,7 @@ export const PostEdit = () => { const { getInputProps, saveButtonProps, - refineCore: { queryResult }, + refineCore: { query: queryResult }, } = useForm({ initialValues: { id: "", diff --git a/examples/blog-refine-markdown/src/pages/posts/edit.tsx b/examples/blog-refine-markdown/src/pages/posts/edit.tsx index 379dd1c6a05c..65415951b917 100644 --- a/examples/blog-refine-markdown/src/pages/posts/edit.tsx +++ b/examples/blog-refine-markdown/src/pages/posts/edit.tsx @@ -7,7 +7,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const { selectProps: categorySelectProps } = useSelect({ resource: "categories", diff --git a/examples/blog-refine-mui/src/pages/products/edit.tsx b/examples/blog-refine-mui/src/pages/products/edit.tsx index 070b7a45e207..30fae7ebae62 100644 --- a/examples/blog-refine-mui/src/pages/products/edit.tsx +++ b/examples/blog-refine-mui/src/pages/products/edit.tsx @@ -14,7 +14,7 @@ export const ProductEdit = () => { const translate = useTranslate(); const { saveButtonProps, - refineCore: { queryResult }, + refineCore: { query: queryResult }, register, control, formState: { errors }, diff --git a/examples/blog-refine-primereact/src/pages/categories/edit.tsx b/examples/blog-refine-primereact/src/pages/categories/edit.tsx index 88cf8295701c..bf2a23af95ce 100644 --- a/examples/blog-refine-primereact/src/pages/categories/edit.tsx +++ b/examples/blog-refine-primereact/src/pages/categories/edit.tsx @@ -13,7 +13,7 @@ export const CategoryEdit = () => { const goBack = useBack(); const { - refineCore: { onFinish, formLoading, queryResult }, + refineCore: { onFinish, formLoading, query: queryResult }, handleSubmit, control, formState: { errors }, diff --git a/examples/blog-refine-primereact/src/pages/products/edit.tsx b/examples/blog-refine-primereact/src/pages/products/edit.tsx index 87f3417e3f7e..dce9bc4da88c 100644 --- a/examples/blog-refine-primereact/src/pages/products/edit.tsx +++ b/examples/blog-refine-primereact/src/pages/products/edit.tsx @@ -16,7 +16,7 @@ export const ProductEdit = () => { const goBack = useBack(); const { - refineCore: { onFinish, formLoading, queryResult }, + refineCore: { onFinish, formLoading, query: queryResult }, handleSubmit, control, formState: { errors }, diff --git a/examples/blog-refine-shadcn/src/pages/blog-posts/edit.tsx b/examples/blog-refine-shadcn/src/pages/blog-posts/edit.tsx index 42e191a69945..50e7f161f94d 100644 --- a/examples/blog-refine-shadcn/src/pages/blog-posts/edit.tsx +++ b/examples/blog-refine-shadcn/src/pages/blog-posts/edit.tsx @@ -30,7 +30,7 @@ export const BlogPostEdit: React.FC = () => { const { list } = useNavigation(); const { - refineCore: { onFinish, queryResult }, + refineCore: { onFinish, query: queryResult }, ...form } = useForm({ refineCoreProps: { diff --git a/examples/command-palette-kbar/src/pages/posts/edit.tsx b/examples/command-palette-kbar/src/pages/posts/edit.tsx index 541c82f7508c..261b6188878f 100644 --- a/examples/command-palette-kbar/src/pages/posts/edit.tsx +++ b/examples/command-palette-kbar/src/pages/posts/edit.tsx @@ -8,7 +8,11 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm({ + const { + formProps, + saveButtonProps, + query: queryResult, + } = useForm({ warnWhenUnsavedChanges: true, }); diff --git a/examples/customization-login/src/pages/posts/edit.tsx b/examples/customization-login/src/pages/posts/edit.tsx index a7ac2428084d..d160dc4d3a62 100644 --- a/examples/customization-login/src/pages/posts/edit.tsx +++ b/examples/customization-login/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/customization-offlayout-area/src/components/sider/index.tsx b/examples/customization-offlayout-area/src/components/sider/index.tsx index 8adb0da4ec1b..6552cf16329f 100644 --- a/examples/customization-offlayout-area/src/components/sider/index.tsx +++ b/examples/customization-offlayout-area/src/components/sider/index.tsx @@ -126,7 +126,6 @@ export const FixedSider: React.FC = () => { > - { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/customization-theme-antd/src/pages/posts/edit.tsx b/examples/customization-theme-antd/src/pages/posts/edit.tsx index 4951431377df..b9e4cb0a1950 100644 --- a/examples/customization-theme-antd/src/pages/posts/edit.tsx +++ b/examples/customization-theme-antd/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/customization-theme-chakra-ui/src/pages/posts/edit.tsx b/examples/customization-theme-chakra-ui/src/pages/posts/edit.tsx index 8d5596c118c3..8a72ceaf6f0c 100644 --- a/examples/customization-theme-chakra-ui/src/pages/posts/edit.tsx +++ b/examples/customization-theme-chakra-ui/src/pages/posts/edit.tsx @@ -14,7 +14,7 @@ import type { IPost } from "../../interfaces"; export const PostEdit = () => { const { - refineCore: { formLoading, queryResult }, + refineCore: { formLoading, query: queryResult }, saveButtonProps, register, formState: { errors }, diff --git a/examples/customization-theme-mantine/src/pages/posts/edit.tsx b/examples/customization-theme-mantine/src/pages/posts/edit.tsx index e04c3ec36968..b0bd380ba462 100644 --- a/examples/customization-theme-mantine/src/pages/posts/edit.tsx +++ b/examples/customization-theme-mantine/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ export const PostEdit: React.FC = () => { saveButtonProps, getInputProps, errors, - refineCore: { queryResult }, + refineCore: { query: queryResult }, } = useForm({ initialValues: { title: "", diff --git a/examples/customization-theme-material-ui/src/pages/posts/edit.tsx b/examples/customization-theme-material-ui/src/pages/posts/edit.tsx index 45452e63c22e..cd3a18e1908d 100644 --- a/examples/customization-theme-material-ui/src/pages/posts/edit.tsx +++ b/examples/customization-theme-material-ui/src/pages/posts/edit.tsx @@ -12,7 +12,7 @@ import type { IPost, ICategory, Nullable, IStatus } from "../../interfaces"; export const PostEdit: React.FC = () => { const { saveButtonProps, - refineCore: { queryResult }, + refineCore: { query: queryResult }, register, control, formState: { errors }, diff --git a/examples/data-provider-airtable/src/pages/blog-posts/edit.tsx b/examples/data-provider-airtable/src/pages/blog-posts/edit.tsx index 6fa814b13d11..a4542b6473b8 100644 --- a/examples/data-provider-airtable/src/pages/blog-posts/edit.tsx +++ b/examples/data-provider-airtable/src/pages/blog-posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const BlogPostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/data-provider-appwrite/src/pages/posts/edit.tsx b/examples/data-provider-appwrite/src/pages/posts/edit.tsx index 2e75ea84790d..8f56be26e339 100644 --- a/examples/data-provider-appwrite/src/pages/posts/edit.tsx +++ b/examples/data-provider-appwrite/src/pages/posts/edit.tsx @@ -12,11 +12,11 @@ import type { IPost, IPostVariables, ICategory } from "../../interfaces"; import { normalizeFile, storage } from "../../utility"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm< - IPost, - HttpError, - IPostVariables - >({ + const { + formProps, + saveButtonProps, + query: queryResult, + } = useForm({ queryOptions: { select: ({ data }) => { return { diff --git a/examples/data-provider-hasura/src/pages/categories/edit.tsx b/examples/data-provider-hasura/src/pages/categories/edit.tsx index 79803ea61d3b..1c2a1e490d08 100644 --- a/examples/data-provider-hasura/src/pages/categories/edit.tsx +++ b/examples/data-provider-hasura/src/pages/categories/edit.tsx @@ -12,7 +12,11 @@ import type { import { CATEGORY_UPDATE_MUTATION } from "./queries"; export const CategoryEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm< + const { + formProps, + saveButtonProps, + query: queryResult, + } = useForm< GetFields, HttpError, GetVariables diff --git a/examples/data-provider-hasura/src/pages/posts/edit.tsx b/examples/data-provider-hasura/src/pages/posts/edit.tsx index 5abb74469f1e..6a8795b94390 100644 --- a/examples/data-provider-hasura/src/pages/posts/edit.tsx +++ b/examples/data-provider-hasura/src/pages/posts/edit.tsx @@ -26,7 +26,12 @@ import type { import { POST_CATEGORIES_SELECT_QUERY, POST_UPDATE_MUTATION } from "./queries"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult, formLoading } = useForm< + const { + formProps, + saveButtonProps, + query: queryResult, + formLoading, + } = useForm< GetFields, HttpError, GetVariables diff --git a/examples/data-provider-nestjs-query/src/pages/categories/edit.tsx b/examples/data-provider-nestjs-query/src/pages/categories/edit.tsx index 8b0af136561b..6181350ce910 100644 --- a/examples/data-provider-nestjs-query/src/pages/categories/edit.tsx +++ b/examples/data-provider-nestjs-query/src/pages/categories/edit.tsx @@ -7,9 +7,11 @@ import { CATEGORY_EDIT_MUTATION } from "./queries"; import type { CategoryEditMutation } from "graphql/types"; export const CategoryEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm< - GetFields - >({ + const { + formProps, + saveButtonProps, + query: queryResult, + } = useForm>({ metaData: { gqlMutation: CATEGORY_EDIT_MUTATION, }, diff --git a/examples/data-provider-nestjs-query/src/pages/posts/edit.tsx b/examples/data-provider-nestjs-query/src/pages/posts/edit.tsx index ee44800d9f23..c13d5107319d 100644 --- a/examples/data-provider-nestjs-query/src/pages/posts/edit.tsx +++ b/examples/data-provider-nestjs-query/src/pages/posts/edit.tsx @@ -15,10 +15,11 @@ import { CATEGORIES_SELECT_QUERY, POST_EDIT_MUTATION } from "./queries"; import type { CategoriesSelectQuery, PostEditMutation } from "graphql/types"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm< - GetFields, - HttpError - >({ + const { + formProps, + saveButtonProps, + query: queryResult, + } = useForm, HttpError>({ metaData: { gqlMutation: POST_EDIT_MUTATION, }, diff --git a/examples/data-provider-nestjsx-crud/src/pages/posts/edit.tsx b/examples/data-provider-nestjsx-crud/src/pages/posts/edit.tsx index 31e59050c111..611c4c792f29 100644 --- a/examples/data-provider-nestjsx-crud/src/pages/posts/edit.tsx +++ b/examples/data-provider-nestjsx-crud/src/pages/posts/edit.tsx @@ -11,7 +11,7 @@ import type { IPost, ICategory, ITags } from "../../interfaces"; import { normalizeFile } from "../../utility/normalize"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const apiUrl = useApiUrl(); const postData = queryResult?.data?.data; diff --git a/examples/data-provider-strapi-v4/src/pages/posts/edit.tsx b/examples/data-provider-strapi-v4/src/pages/posts/edit.tsx index ee341353a05c..71f6a5ef2976 100644 --- a/examples/data-provider-strapi-v4/src/pages/posts/edit.tsx +++ b/examples/data-provider-strapi-v4/src/pages/posts/edit.tsx @@ -8,7 +8,11 @@ import { TOKEN_KEY, API_URL } from "../../constants"; import type { ICategory, IPost } from "../../interfaces"; export const PostEdit: React.FC = () => { - const { formProps, saveButtonProps, queryResult } = useForm({ + const { + formProps, + saveButtonProps, + query: queryResult, + } = useForm({ metaData: { populate: ["category", "cover"] }, }); diff --git a/examples/data-provider-strapi/src/pages/posts/create.tsx b/examples/data-provider-strapi/src/pages/posts/create.tsx index e3995a5262d5..a32b4a18641a 100644 --- a/examples/data-provider-strapi/src/pages/posts/create.tsx +++ b/examples/data-provider-strapi/src/pages/posts/create.tsx @@ -18,7 +18,7 @@ import { TOKEN_KEY } from "../../constants"; export const PostCreate = () => { const API_URL = useApiUrl(); - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps } = useSelect({ diff --git a/examples/data-provider-supabase/src/pages/posts/edit.tsx b/examples/data-provider-supabase/src/pages/posts/edit.tsx index 94b946cf9c7f..11f91f0a4e4a 100644 --- a/examples/data-provider-supabase/src/pages/posts/edit.tsx +++ b/examples/data-provider-supabase/src/pages/posts/edit.tsx @@ -18,7 +18,11 @@ import { supabaseClient, normalizeFile } from "../../utility"; export const PostEdit = () => { const [isDeprecated, setIsDeprecated] = useState(false); - const { formProps, saveButtonProps, queryResult } = useForm({ + const { + formProps, + saveButtonProps, + query: queryResult, + } = useForm({ liveMode: "manual", onLiveEvent: () => { setIsDeprecated(true); diff --git a/examples/field-antd-use-select-basic/src/pages/posts/edit.tsx b/examples/field-antd-use-select-basic/src/pages/posts/edit.tsx index 8be78509a257..69e8f083388d 100644 --- a/examples/field-antd-use-select-basic/src/pages/posts/edit.tsx +++ b/examples/field-antd-use-select-basic/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory, ITag } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/field-antd-use-select-infinite/src/pages/posts/edit.tsx b/examples/field-antd-use-select-infinite/src/pages/posts/edit.tsx index 02cabe3559fa..cc02753b116c 100644 --- a/examples/field-antd-use-select-infinite/src/pages/posts/edit.tsx +++ b/examples/field-antd-use-select-infinite/src/pages/posts/edit.tsx @@ -6,7 +6,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/field-material-ui-use-autocomplete/src/pages/posts/edit.tsx b/examples/field-material-ui-use-autocomplete/src/pages/posts/edit.tsx index f630c670e21f..87f7a1b6097b 100644 --- a/examples/field-material-ui-use-autocomplete/src/pages/posts/edit.tsx +++ b/examples/field-material-ui-use-autocomplete/src/pages/posts/edit.tsx @@ -18,7 +18,7 @@ import type { export const PostEdit: React.FC = () => { const { saveButtonProps, - refineCore: { formLoading, queryResult }, + refineCore: { formLoading, query: queryResult }, register, control, formState: { errors }, diff --git a/examples/finefoods-antd/src/pages/couriers/edit.tsx b/examples/finefoods-antd/src/pages/couriers/edit.tsx index 527e9b3142b1..35043a181a7d 100644 --- a/examples/finefoods-antd/src/pages/couriers/edit.tsx +++ b/examples/finefoods-antd/src/pages/couriers/edit.tsx @@ -49,7 +49,11 @@ export const CourierEdit = () => { const t = useTranslate(); const { list } = useNavigation(); - const { formProps, queryResult, saveButtonProps } = useForm(); + const { + formProps, + query: queryResult, + saveButtonProps, + } = useForm(); const courier = queryResult?.data?.data; const { selectProps: storeSelectProps } = useSelect({ diff --git a/examples/finefoods-antd/src/pages/couriers/list.tsx b/examples/finefoods-antd/src/pages/couriers/list.tsx index 1445ef2c21e3..10680c025cbe 100644 --- a/examples/finefoods-antd/src/pages/couriers/list.tsx +++ b/examples/finefoods-antd/src/pages/couriers/list.tsx @@ -221,8 +221,8 @@ export const CourierList = ({ children }: PropsWithChildren) => { {/* - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore */} + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore */} {(props: InputProps) => } diff --git a/examples/finefoods-material-ui/src/pages/couriers/edit.tsx b/examples/finefoods-material-ui/src/pages/couriers/edit.tsx index 06c29bcdb5fd..5bd542cc3790 100644 --- a/examples/finefoods-material-ui/src/pages/couriers/edit.tsx +++ b/examples/finefoods-material-ui/src/pages/couriers/edit.tsx @@ -37,7 +37,7 @@ export const CourierEdit = () => { control, setValue, formState: { errors }, - refineCore: { formLoading, queryResult }, + refineCore: { formLoading, query: queryResult }, saveButtonProps, } = useForm>(); const courier = queryResult?.data?.data; diff --git a/examples/form-antd-custom-validation/src/pages/posts/edit.tsx b/examples/form-antd-custom-validation/src/pages/posts/edit.tsx index b07ed68e9bcd..ba73e5d14d42 100644 --- a/examples/form-antd-custom-validation/src/pages/posts/edit.tsx +++ b/examples/form-antd-custom-validation/src/pages/posts/edit.tsx @@ -19,7 +19,7 @@ interface PostUniqueCheckRequestQuery { } export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/form-antd-mutation-mode/src/pages/posts/create.tsx b/examples/form-antd-mutation-mode/src/pages/posts/create.tsx index 4cd0269cd6b3..d4dc5197f784 100644 --- a/examples/form-antd-mutation-mode/src/pages/posts/create.tsx +++ b/examples/form-antd-mutation-mode/src/pages/posts/create.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostCreate = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; diff --git a/examples/form-antd-mutation-mode/src/pages/posts/edit.tsx b/examples/form-antd-mutation-mode/src/pages/posts/edit.tsx index 3a1b2207f487..d45ac34e60f4 100644 --- a/examples/form-antd-mutation-mode/src/pages/posts/edit.tsx +++ b/examples/form-antd-mutation-mode/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; diff --git a/examples/form-antd-use-form/src/pages/posts/create.tsx b/examples/form-antd-use-form/src/pages/posts/create.tsx index 4cd0269cd6b3..d4dc5197f784 100644 --- a/examples/form-antd-use-form/src/pages/posts/create.tsx +++ b/examples/form-antd-use-form/src/pages/posts/create.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostCreate = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; diff --git a/examples/form-antd-use-form/src/pages/posts/edit.tsx b/examples/form-antd-use-form/src/pages/posts/edit.tsx index 3a1b2207f487..d45ac34e60f4 100644 --- a/examples/form-antd-use-form/src/pages/posts/edit.tsx +++ b/examples/form-antd-use-form/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; diff --git a/examples/form-chakra-ui-mutation-mode/src/pages/posts/edit.tsx b/examples/form-chakra-ui-mutation-mode/src/pages/posts/edit.tsx index 645df021ff63..da7bfba1bace 100644 --- a/examples/form-chakra-ui-mutation-mode/src/pages/posts/edit.tsx +++ b/examples/form-chakra-ui-mutation-mode/src/pages/posts/edit.tsx @@ -14,7 +14,7 @@ import type { IPost } from "../../interfaces"; export const PostEdit = () => { const { - refineCore: { formLoading, queryResult }, + refineCore: { formLoading, query: queryResult }, saveButtonProps, register, formState: { errors }, diff --git a/examples/form-chakra-ui-use-form/src/pages/posts/edit.tsx b/examples/form-chakra-ui-use-form/src/pages/posts/edit.tsx index e117e95bdafb..9d0b3ce3354a 100644 --- a/examples/form-chakra-ui-use-form/src/pages/posts/edit.tsx +++ b/examples/form-chakra-ui-use-form/src/pages/posts/edit.tsx @@ -15,7 +15,7 @@ import type { IPost } from "../../interfaces"; export const PostEdit = () => { const { - refineCore: { formLoading, queryResult }, + refineCore: { formLoading, query: queryResult }, saveButtonProps, register, formState: { errors }, diff --git a/examples/form-core-use-form/src/pages/posts/create.tsx b/examples/form-core-use-form/src/pages/posts/create.tsx index 9cd56e95c5c0..50a68ec18aa9 100644 --- a/examples/form-core-use-form/src/pages/posts/create.tsx +++ b/examples/form-core-use-form/src/pages/posts/create.tsx @@ -5,11 +5,11 @@ import type { IPost } from "../../interfaces"; type FormValues = Omit; export const PostCreate: React.FC = () => { - const { formLoading, onFinish, queryResult } = useForm< - IPost, - HttpError, - FormValues - >(); + const { + formLoading, + onFinish, + query: queryResult, + } = useForm(); // if action is "clone", we'll have defaultValues const defaultValues = queryResult?.data?.data; diff --git a/examples/form-core-use-form/src/pages/posts/edit.tsx b/examples/form-core-use-form/src/pages/posts/edit.tsx index e668618d1a3e..5725d19ebd5c 100644 --- a/examples/form-core-use-form/src/pages/posts/edit.tsx +++ b/examples/form-core-use-form/src/pages/posts/edit.tsx @@ -8,7 +8,7 @@ export const PostEdit: React.FC = () => { const { formLoading, onFinish, - queryResult, + query: queryResult, autoSaveProps, onFinishAutoSave, } = useForm({ diff --git a/examples/form-mantine-mutation-mode/src/pages/posts/edit.tsx b/examples/form-mantine-mutation-mode/src/pages/posts/edit.tsx index 0263807ea69f..87aa5c334e4c 100644 --- a/examples/form-mantine-mutation-mode/src/pages/posts/edit.tsx +++ b/examples/form-mantine-mutation-mode/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ export const PostEdit: React.FC = () => { saveButtonProps, getInputProps, errors, - refineCore: { queryResult }, + refineCore: { query: queryResult }, } = useForm({ initialValues: { title: "", diff --git a/examples/form-mantine-use-form/src/pages/posts/edit.tsx b/examples/form-mantine-use-form/src/pages/posts/edit.tsx index 0263807ea69f..87aa5c334e4c 100644 --- a/examples/form-mantine-use-form/src/pages/posts/edit.tsx +++ b/examples/form-mantine-use-form/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ export const PostEdit: React.FC = () => { saveButtonProps, getInputProps, errors, - refineCore: { queryResult }, + refineCore: { query: queryResult }, } = useForm({ initialValues: { title: "", diff --git a/examples/form-material-ui-mutation-mode/src/pages/posts/edit.tsx b/examples/form-material-ui-mutation-mode/src/pages/posts/edit.tsx index f81bbe02c056..661200e9d07d 100644 --- a/examples/form-material-ui-mutation-mode/src/pages/posts/edit.tsx +++ b/examples/form-material-ui-mutation-mode/src/pages/posts/edit.tsx @@ -12,7 +12,7 @@ import type { ICategory, IPost, IStatus, Nullable } from "../../interfaces"; export const PostEdit: React.FC = () => { const { saveButtonProps, - refineCore: { queryResult }, + refineCore: { query: queryResult }, register, control, formState: { errors }, diff --git a/examples/form-material-ui-use-form/src/pages/posts/edit.tsx b/examples/form-material-ui-use-form/src/pages/posts/edit.tsx index f81bbe02c056..661200e9d07d 100644 --- a/examples/form-material-ui-use-form/src/pages/posts/edit.tsx +++ b/examples/form-material-ui-use-form/src/pages/posts/edit.tsx @@ -12,7 +12,7 @@ import type { ICategory, IPost, IStatus, Nullable } from "../../interfaces"; export const PostEdit: React.FC = () => { const { saveButtonProps, - refineCore: { queryResult }, + refineCore: { query: queryResult }, register, control, formState: { errors }, diff --git a/examples/form-react-hook-form-use-form/src/pages/posts/edit.tsx b/examples/form-react-hook-form-use-form/src/pages/posts/edit.tsx index 31c133191a13..69a3e1e3fe65 100644 --- a/examples/form-react-hook-form-use-form/src/pages/posts/edit.tsx +++ b/examples/form-react-hook-form-use-form/src/pages/posts/edit.tsx @@ -5,7 +5,7 @@ import { useBack, useSelect } from "@refinedev/core"; export const PostEdit: React.FC = () => { const back = useBack(); const { - refineCore: { onFinish, formLoading, queryResult }, + refineCore: { onFinish, formLoading, query: queryResult }, register, handleSubmit, formState: { errors }, diff --git a/examples/form-save-and-continue/src/pages/posts/edit.tsx b/examples/form-save-and-continue/src/pages/posts/edit.tsx index 37e99e2b482e..bacaa57064d0 100644 --- a/examples/form-save-and-continue/src/pages/posts/edit.tsx +++ b/examples/form-save-and-continue/src/pages/posts/edit.tsx @@ -4,7 +4,12 @@ import { useSelect, useForm, useNavigation } from "@refinedev/core"; import type { IPost } from "../../interfaces"; export const PostEdit: React.FC = () => { - const { formLoading, onFinish, redirect, queryResult } = useForm({ + const { + formLoading, + onFinish, + redirect, + query: queryResult, + } = useForm({ redirect: false, }); diff --git a/examples/i18n-nextjs/src/app/blog-posts/edit/[id]/page.tsx b/examples/i18n-nextjs/src/app/blog-posts/edit/[id]/page.tsx index c414704bd68e..13a1a8d5f197 100644 --- a/examples/i18n-nextjs/src/app/blog-posts/edit/[id]/page.tsx +++ b/examples/i18n-nextjs/src/app/blog-posts/edit/[id]/page.tsx @@ -6,7 +6,7 @@ import { Form, Input, Select } from "antd"; export default function BlogPostEdit() { const { translate: t } = useTranslation(); - const { formProps, saveButtonProps, queryResult } = useForm({}); + const { formProps, saveButtonProps, query: queryResult } = useForm({}); const blogPostsData = queryResult?.data?.data; diff --git a/examples/i18n-react/src/pages/posts/edit.tsx b/examples/i18n-react/src/pages/posts/edit.tsx index 5d5bb562610b..b7bc0fd22fea 100644 --- a/examples/i18n-react/src/pages/posts/edit.tsx +++ b/examples/i18n-react/src/pages/posts/edit.tsx @@ -7,7 +7,7 @@ import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { const { translate } = useTranslation(); - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/import-export-antd/src/pages/posts/edit.tsx b/examples/import-export-antd/src/pages/posts/edit.tsx index 311aca1c7768..a29d411df4a0 100644 --- a/examples/import-export-antd/src/pages/posts/edit.tsx +++ b/examples/import-export-antd/src/pages/posts/edit.tsx @@ -6,7 +6,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/input-custom/src/pages/posts/edit.tsx b/examples/input-custom/src/pages/posts/edit.tsx index 311aca1c7768..a29d411df4a0 100644 --- a/examples/input-custom/src/pages/posts/edit.tsx +++ b/examples/input-custom/src/pages/posts/edit.tsx @@ -6,7 +6,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/input-date-picker/src/pages/posts/edit.tsx b/examples/input-date-picker/src/pages/posts/edit.tsx index 7470b2f84c31..ae9ccf4ad99a 100644 --- a/examples/input-date-picker/src/pages/posts/edit.tsx +++ b/examples/input-date-picker/src/pages/posts/edit.tsx @@ -7,7 +7,7 @@ import dayjs from "dayjs"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/invoicer/src/pages/accounts/edit.tsx b/examples/invoicer/src/pages/accounts/edit.tsx index 74023dbe9c4f..ac1508d25422 100644 --- a/examples/invoicer/src/pages/accounts/edit.tsx +++ b/examples/invoicer/src/pages/accounts/edit.tsx @@ -30,7 +30,11 @@ import type { Account, AccountForm } from "@/types"; export const AccountsPageEdit = () => { const { listUrl } = useNavigation(); - const { formProps, queryResult } = useForm({ + const { formProps, query: queryResult } = useForm< + Account, + HttpError, + AccountForm + >({ redirect: false, meta: { populate: ["logo", "clients", "invoices.client"], diff --git a/examples/invoicer/src/pages/clients/edit.tsx b/examples/invoicer/src/pages/clients/edit.tsx index 5b595f203078..fae111b53244 100644 --- a/examples/invoicer/src/pages/clients/edit.tsx +++ b/examples/invoicer/src/pages/clients/edit.tsx @@ -30,7 +30,7 @@ import type { Invoice } from "@/types"; export const ClientsPageEdit = () => { const { list } = useNavigation(); - const { formProps, queryResult } = useForm({ + const { formProps, query: queryResult } = useForm({ redirect: false, meta: { populate: ["account", "invoices.client", "invoices.account.logo"], diff --git a/examples/live-provider-ably/src/pages/posts/edit.tsx b/examples/live-provider-ably/src/pages/posts/edit.tsx index f85ae11d0b3d..3e53bdb8ce2c 100644 --- a/examples/live-provider-ably/src/pages/posts/edit.tsx +++ b/examples/live-provider-ably/src/pages/posts/edit.tsx @@ -16,7 +16,11 @@ export const PostEdit = () => { "deleted" | "updated" | undefined >(); - const { formProps, saveButtonProps, queryResult } = useForm({ + const { + formProps, + saveButtonProps, + query: queryResult, + } = useForm({ liveMode: "manual", onLiveEvent: (event) => { if (event.type === "deleted" || event.type === "updated") { diff --git a/examples/loading-overtime/src/pages/posts/edit.tsx b/examples/loading-overtime/src/pages/posts/edit.tsx index 541c82f7508c..261b6188878f 100644 --- a/examples/loading-overtime/src/pages/posts/edit.tsx +++ b/examples/loading-overtime/src/pages/posts/edit.tsx @@ -8,7 +8,11 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm({ + const { + formProps, + saveButtonProps, + query: queryResult, + } = useForm({ warnWhenUnsavedChanges: true, }); diff --git a/examples/monorepo-module-federation/apps/blog-posts/src/pages/blog-posts/edit.tsx b/examples/monorepo-module-federation/apps/blog-posts/src/pages/blog-posts/edit.tsx index 1a956d8a75ba..8da77c2807ba 100644 --- a/examples/monorepo-module-federation/apps/blog-posts/src/pages/blog-posts/edit.tsx +++ b/examples/monorepo-module-federation/apps/blog-posts/src/pages/blog-posts/edit.tsx @@ -8,13 +8,17 @@ import MDEditor from "@uiw/react-md-editor"; import type { ICategory, IPost } from "../../interfaces"; const PostEdit = () => { - const { formProps, saveButtonProps, queryResult, autoSaveProps } = - useForm({ - warnWhenUnsavedChanges: true, - autoSave: { - enabled: true, - }, - }); + const { + formProps, + saveButtonProps, + query: queryResult, + autoSaveProps, + } = useForm({ + warnWhenUnsavedChanges: true, + autoSave: { + enabled: true, + }, + }); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/multi-level-menu/src/pages/posts/edit.tsx b/examples/multi-level-menu/src/pages/posts/edit.tsx index 7ca6d24dfb74..081d1a9e8785 100644 --- a/examples/multi-level-menu/src/pages/posts/edit.tsx +++ b/examples/multi-level-menu/src/pages/posts/edit.tsx @@ -7,7 +7,11 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm({ + const { + formProps, + saveButtonProps, + query: queryResult, + } = useForm({ warnWhenUnsavedChanges: true, }); diff --git a/examples/new-routing-example/src/pages/posts/edit.tsx b/examples/new-routing-example/src/pages/posts/edit.tsx index f66824f924bf..0db6df8ec42a 100644 --- a/examples/new-routing-example/src/pages/posts/edit.tsx +++ b/examples/new-routing-example/src/pages/posts/edit.tsx @@ -6,7 +6,11 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm({ + const { + formProps, + saveButtonProps, + query: queryResult, + } = useForm({ warnWhenUnsavedChanges: true, }); diff --git a/examples/refine-week-invoice-generator/src/pages/contacts/edit.tsx b/examples/refine-week-invoice-generator/src/pages/contacts/edit.tsx index 18c31944a16b..3aac25596417 100755 --- a/examples/refine-week-invoice-generator/src/pages/contacts/edit.tsx +++ b/examples/refine-week-invoice-generator/src/pages/contacts/edit.tsx @@ -4,7 +4,11 @@ import { Form, Select, Input } from "antd"; import type { IContact } from "../../interfaces"; export const EditContact = () => { - const { formProps, saveButtonProps, queryResult } = useForm({ + const { + formProps, + saveButtonProps, + query: queryResult, + } = useForm({ meta: { populate: ["client"] }, }); diff --git a/examples/search/src/pages/posts/edit.tsx b/examples/search/src/pages/posts/edit.tsx index 311aca1c7768..a29d411df4a0 100644 --- a/examples/search/src/pages/posts/edit.tsx +++ b/examples/search/src/pages/posts/edit.tsx @@ -6,7 +6,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/server-side-form-validation-antd/src/pages/posts/edit.tsx b/examples/server-side-form-validation-antd/src/pages/posts/edit.tsx index a20f27ef247c..15e82fccd099 100644 --- a/examples/server-side-form-validation-antd/src/pages/posts/edit.tsx +++ b/examples/server-side-form-validation-antd/src/pages/posts/edit.tsx @@ -9,11 +9,11 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm< - IPost, - HttpError, - IPost - >(); + const { + formProps, + saveButtonProps, + query: queryResult, + } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/server-side-form-validation-chakra-ui/src/pages/posts/edit.tsx b/examples/server-side-form-validation-chakra-ui/src/pages/posts/edit.tsx index 7f5d33021f1d..e405a076f639 100644 --- a/examples/server-side-form-validation-chakra-ui/src/pages/posts/edit.tsx +++ b/examples/server-side-form-validation-chakra-ui/src/pages/posts/edit.tsx @@ -15,7 +15,7 @@ import type { IPost } from "../../interfaces"; export const PostEdit = () => { const { - refineCore: { formLoading, queryResult }, + refineCore: { formLoading, query: queryResult }, saveButtonProps, register, formState: { errors }, diff --git a/examples/server-side-form-validation-mantine/src/pages/posts/edit.tsx b/examples/server-side-form-validation-mantine/src/pages/posts/edit.tsx index 5ac718810a88..5c2709420ac6 100644 --- a/examples/server-side-form-validation-mantine/src/pages/posts/edit.tsx +++ b/examples/server-side-form-validation-mantine/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ export const PostEdit: React.FC = () => { saveButtonProps, getInputProps, errors, - refineCore: { queryResult }, + refineCore: { query: queryResult }, } = useForm({ initialValues: { title: "", diff --git a/examples/server-side-form-validation-material-ui/src/pages/posts/edit.tsx b/examples/server-side-form-validation-material-ui/src/pages/posts/edit.tsx index c090b1b84e06..7882cc4a79b5 100644 --- a/examples/server-side-form-validation-material-ui/src/pages/posts/edit.tsx +++ b/examples/server-side-form-validation-material-ui/src/pages/posts/edit.tsx @@ -12,7 +12,7 @@ import type { IPost, ICategory, Nullable, IStatus } from "../../interfaces"; export const PostEdit: React.FC = () => { const { saveButtonProps, - refineCore: { queryResult }, + refineCore: { query: queryResult }, register, control, formState: { errors }, diff --git a/examples/store/src/components/profile/ProfileBillingAddress/ProfileBillingAddress.tsx b/examples/store/src/components/profile/ProfileBillingAddress/ProfileBillingAddress.tsx index 3e53ac06d26e..b6d61bcb0ebb 100644 --- a/examples/store/src/components/profile/ProfileBillingAddress/ProfileBillingAddress.tsx +++ b/examples/store/src/components/profile/ProfileBillingAddress/ProfileBillingAddress.tsx @@ -31,7 +31,7 @@ export const ProfileBillingAddress: React.FC = ({ reset, control, formState: { errors, touchedFields }, - refineCore: { onFinish, mutationResult }, + refineCore: { onFinish, mutation: mutationResult }, } = useForm({ refineCoreProps: { action: "edit", diff --git a/examples/store/src/components/profile/ProfileEmail/ProfileEmail.tsx b/examples/store/src/components/profile/ProfileEmail/ProfileEmail.tsx index 2ff3ae43b02a..f96c8be872ef 100644 --- a/examples/store/src/components/profile/ProfileEmail/ProfileEmail.tsx +++ b/examples/store/src/components/profile/ProfileEmail/ProfileEmail.tsx @@ -26,7 +26,7 @@ export const ProfileEmail: React.FC = ({ customer }) => { reset, control, formState: { errors }, - refineCore: { onFinish, mutationResult }, + refineCore: { onFinish, mutation: mutationResult }, } = useForm({ defaultValues: { email: customer.email, diff --git a/examples/store/src/components/profile/ProfileName/ProfileName.tsx b/examples/store/src/components/profile/ProfileName/ProfileName.tsx index 50444f4fffb1..66dc2151c5e2 100644 --- a/examples/store/src/components/profile/ProfileName/ProfileName.tsx +++ b/examples/store/src/components/profile/ProfileName/ProfileName.tsx @@ -23,7 +23,7 @@ export const ProfileName: React.FC = ({ customer }) => { reset, control, formState: { errors }, - refineCore: { onFinish, mutationResult }, + refineCore: { onFinish, mutation: mutationResult }, } = useForm({ refineCoreProps: { action: "edit", diff --git a/examples/store/src/components/profile/ProfilePassword/ProfilePassword.tsx b/examples/store/src/components/profile/ProfilePassword/ProfilePassword.tsx index 4266f96e34ae..d1626ca0e19b 100644 --- a/examples/store/src/components/profile/ProfilePassword/ProfilePassword.tsx +++ b/examples/store/src/components/profile/ProfilePassword/ProfilePassword.tsx @@ -29,7 +29,7 @@ export const ProfilePassword: React.FC = ({ customer }) => { reset, formState: { errors }, setError, - refineCore: { onFinish, mutationResult }, + refineCore: { onFinish, mutation: mutationResult }, } = useForm({ refineCoreProps: { action: "edit", diff --git a/examples/store/src/components/profile/ProfilePhone/ProfilePhone.tsx b/examples/store/src/components/profile/ProfilePhone/ProfilePhone.tsx index 8b65f4dac889..b508408c25a1 100644 --- a/examples/store/src/components/profile/ProfilePhone/ProfilePhone.tsx +++ b/examples/store/src/components/profile/ProfilePhone/ProfilePhone.tsx @@ -21,7 +21,7 @@ export const ProfilePhone: React.FC = ({ customer }) => { reset, control, formState: { errors }, - refineCore: { onFinish, mutationResult }, + refineCore: { onFinish, mutation: mutationResult }, } = useForm({ refineCoreProps: { action: "edit", diff --git a/examples/table-antd-advanced/src/pages/posts/edit.tsx b/examples/table-antd-advanced/src/pages/posts/edit.tsx index a7ac2428084d..d160dc4d3a62 100644 --- a/examples/table-antd-advanced/src/pages/posts/edit.tsx +++ b/examples/table-antd-advanced/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/table-antd-table-filter/src/pages/posts/edit.tsx b/examples/table-antd-table-filter/src/pages/posts/edit.tsx index 4951431377df..b9e4cb0a1950 100644 --- a/examples/table-antd-table-filter/src/pages/posts/edit.tsx +++ b/examples/table-antd-table-filter/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/table-antd-use-delete-many/src/pages/posts/edit.tsx b/examples/table-antd-use-delete-many/src/pages/posts/edit.tsx index 4951431377df..b9e4cb0a1950 100644 --- a/examples/table-antd-use-delete-many/src/pages/posts/edit.tsx +++ b/examples/table-antd-use-delete-many/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/table-antd-use-update-many/src/pages/posts/edit.tsx b/examples/table-antd-use-update-many/src/pages/posts/edit.tsx index 4951431377df..b9e4cb0a1950 100644 --- a/examples/table-antd-use-update-many/src/pages/posts/edit.tsx +++ b/examples/table-antd-use-update-many/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/table-chakra-ui-basic/src/pages/posts/edit.tsx b/examples/table-chakra-ui-basic/src/pages/posts/edit.tsx index 8d5596c118c3..8a72ceaf6f0c 100644 --- a/examples/table-chakra-ui-basic/src/pages/posts/edit.tsx +++ b/examples/table-chakra-ui-basic/src/pages/posts/edit.tsx @@ -14,7 +14,7 @@ import type { IPost } from "../../interfaces"; export const PostEdit = () => { const { - refineCore: { formLoading, queryResult }, + refineCore: { formLoading, query: queryResult }, saveButtonProps, register, formState: { errors }, diff --git a/examples/theme-antd-demo/src/pages/posts/edit.tsx b/examples/theme-antd-demo/src/pages/posts/edit.tsx index 541c82f7508c..261b6188878f 100644 --- a/examples/theme-antd-demo/src/pages/posts/edit.tsx +++ b/examples/theme-antd-demo/src/pages/posts/edit.tsx @@ -8,7 +8,11 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm({ + const { + formProps, + saveButtonProps, + query: queryResult, + } = useForm({ warnWhenUnsavedChanges: true, }); diff --git a/examples/theme-chakra-ui-demo/src/pages/posts/edit.tsx b/examples/theme-chakra-ui-demo/src/pages/posts/edit.tsx index 8d5596c118c3..8a72ceaf6f0c 100644 --- a/examples/theme-chakra-ui-demo/src/pages/posts/edit.tsx +++ b/examples/theme-chakra-ui-demo/src/pages/posts/edit.tsx @@ -14,7 +14,7 @@ import type { IPost } from "../../interfaces"; export const PostEdit = () => { const { - refineCore: { formLoading, queryResult }, + refineCore: { formLoading, query: queryResult }, saveButtonProps, register, formState: { errors }, diff --git a/examples/theme-mantine-demo/src/pages/posts/edit.tsx b/examples/theme-mantine-demo/src/pages/posts/edit.tsx index 37aed0345594..cfcf6a45d534 100644 --- a/examples/theme-mantine-demo/src/pages/posts/edit.tsx +++ b/examples/theme-mantine-demo/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ export const PostEdit: React.FC = () => { saveButtonProps, getInputProps, errors, - refineCore: { queryResult }, + refineCore: { query: queryResult }, } = useForm({ initialValues: { title: "", diff --git a/examples/theme-material-ui-demo/src/pages/posts/edit.tsx b/examples/theme-material-ui-demo/src/pages/posts/edit.tsx index 5ade870b3715..f071ee3af7db 100644 --- a/examples/theme-material-ui-demo/src/pages/posts/edit.tsx +++ b/examples/theme-material-ui-demo/src/pages/posts/edit.tsx @@ -12,7 +12,7 @@ import type { IPost, ICategory, Nullable, IStatus } from "../../interfaces"; export const PostEdit: React.FC = () => { const { saveButtonProps, - refineCore: { queryResult }, + refineCore: { query: queryResult }, register, control, formState: { errors }, diff --git a/examples/tutorial-antd/src/pages/blog-posts/edit.tsx b/examples/tutorial-antd/src/pages/blog-posts/edit.tsx index 9b0073e3991e..1841178522f4 100644 --- a/examples/tutorial-antd/src/pages/blog-posts/edit.tsx +++ b/examples/tutorial-antd/src/pages/blog-posts/edit.tsx @@ -4,7 +4,7 @@ import { Form, Input, Select, DatePicker } from "antd"; import dayjs from "dayjs"; export const BlogPostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const blogPostsData = queryResult?.data?.data; diff --git a/examples/tutorial-chakra-ui/src/pages/blog-posts/edit.tsx b/examples/tutorial-chakra-ui/src/pages/blog-posts/edit.tsx index 961502c4370f..c3edda7ca4ea 100644 --- a/examples/tutorial-chakra-ui/src/pages/blog-posts/edit.tsx +++ b/examples/tutorial-chakra-ui/src/pages/blog-posts/edit.tsx @@ -12,7 +12,7 @@ import { useSelect } from "@refinedev/core"; export const BlogPostEdit = () => { const { - refineCore: { formLoading, queryResult }, + refineCore: { formLoading, query: queryResult }, saveButtonProps, register, resetField, diff --git a/examples/tutorial-headless/src/pages/blog-posts/edit.tsx b/examples/tutorial-headless/src/pages/blog-posts/edit.tsx index 4520ca5e8cf3..e00fc7b7cae1 100644 --- a/examples/tutorial-headless/src/pages/blog-posts/edit.tsx +++ b/examples/tutorial-headless/src/pages/blog-posts/edit.tsx @@ -6,7 +6,7 @@ export const BlogPostEdit = () => { const { list } = useNavigation(); const { - refineCore: { onFinish, queryResult }, + refineCore: { onFinish, query: queryResult }, register, handleSubmit, resetField, diff --git a/examples/tutorial-mantine/src/pages/blog-posts/edit.tsx b/examples/tutorial-mantine/src/pages/blog-posts/edit.tsx index 142c4b1c70e3..5df8bb87f01c 100644 --- a/examples/tutorial-mantine/src/pages/blog-posts/edit.tsx +++ b/examples/tutorial-mantine/src/pages/blog-posts/edit.tsx @@ -5,7 +5,7 @@ export const BlogPostEdit = () => { const { getInputProps, saveButtonProps, - refineCore: { queryResult }, + refineCore: { query: queryResult }, } = useForm({ initialValues: { id: "", diff --git a/examples/tutorial-material-ui/src/pages/blog-posts/edit.tsx b/examples/tutorial-material-ui/src/pages/blog-posts/edit.tsx index 461e3ed21d15..2e7929b7f057 100644 --- a/examples/tutorial-material-ui/src/pages/blog-posts/edit.tsx +++ b/examples/tutorial-material-ui/src/pages/blog-posts/edit.tsx @@ -8,7 +8,7 @@ import { Controller } from "react-hook-form"; export const BlogPostEdit = () => { const { saveButtonProps, - refineCore: { queryResult }, + refineCore: { query: queryResult }, register, control, formState: { errors }, diff --git a/examples/upload-antd-multipart/src/pages/posts/edit.tsx b/examples/upload-antd-multipart/src/pages/posts/edit.tsx index 95090fd2b862..2f3a18a23ee6 100644 --- a/examples/upload-antd-multipart/src/pages/posts/edit.tsx +++ b/examples/upload-antd-multipart/src/pages/posts/edit.tsx @@ -10,7 +10,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/upload-chakra-ui-basic64/src/pages/posts/edit.tsx b/examples/upload-chakra-ui-basic64/src/pages/posts/edit.tsx index 14575b70b0ce..bfa6e6feaae7 100644 --- a/examples/upload-chakra-ui-basic64/src/pages/posts/edit.tsx +++ b/examples/upload-chakra-ui-basic64/src/pages/posts/edit.tsx @@ -22,7 +22,7 @@ import type { IPost } from "../../interfaces"; export const PostEdit = () => { const { - refineCore: { formLoading, queryResult }, + refineCore: { formLoading, query: queryResult }, saveButtonProps, register, watch, diff --git a/examples/upload-chakra-ui-multipart/src/pages/posts/edit.tsx b/examples/upload-chakra-ui-multipart/src/pages/posts/edit.tsx index 65c5a94bc9b2..914958de0382 100644 --- a/examples/upload-chakra-ui-multipart/src/pages/posts/edit.tsx +++ b/examples/upload-chakra-ui-multipart/src/pages/posts/edit.tsx @@ -24,7 +24,7 @@ export const PostEdit = () => { const [uploading, setUploading] = useState(false); const apiUrl = useApiUrl(); const { - refineCore: { formLoading, queryResult }, + refineCore: { formLoading, query: queryResult }, saveButtonProps, register, watch, diff --git a/examples/upload-mantine-base64/src/pages/posts/edit.tsx b/examples/upload-mantine-base64/src/pages/posts/edit.tsx index 8715ce524c85..5a64b5288155 100644 --- a/examples/upload-mantine-base64/src/pages/posts/edit.tsx +++ b/examples/upload-mantine-base64/src/pages/posts/edit.tsx @@ -31,7 +31,7 @@ export const PostEdit: React.FC = () => { setFieldValue, values, errors, - refineCore: { queryResult }, + refineCore: { query: queryResult }, } = useForm({ initialValues: { title: "", diff --git a/examples/upload-mantine-multipart/src/pages/posts/edit.tsx b/examples/upload-mantine-multipart/src/pages/posts/edit.tsx index 39b43f5f36be..b488763928cc 100644 --- a/examples/upload-mantine-multipart/src/pages/posts/edit.tsx +++ b/examples/upload-mantine-multipart/src/pages/posts/edit.tsx @@ -36,7 +36,7 @@ export const PostEdit: React.FC = () => { setFieldValue, values, errors, - refineCore: { queryResult }, + refineCore: { query: queryResult }, } = useForm({ initialValues: { title: "", diff --git a/examples/upload-material-ui-base64/src/pages/posts/edit.tsx b/examples/upload-material-ui-base64/src/pages/posts/edit.tsx index fe5ff3466d7b..30536e544205 100644 --- a/examples/upload-material-ui-base64/src/pages/posts/edit.tsx +++ b/examples/upload-material-ui-base64/src/pages/posts/edit.tsx @@ -19,7 +19,7 @@ export const PostEdit: React.FC = () => { const { saveButtonProps, - refineCore: { queryResult }, + refineCore: { query: queryResult }, register, control, formState: { errors }, diff --git a/examples/upload-material-ui-multipart/src/pages/posts/edit.tsx b/examples/upload-material-ui-multipart/src/pages/posts/edit.tsx index bfde680d53f8..54a2922c883d 100644 --- a/examples/upload-material-ui-multipart/src/pages/posts/edit.tsx +++ b/examples/upload-material-ui-multipart/src/pages/posts/edit.tsx @@ -21,7 +21,7 @@ export const PostEdit: React.FC = () => { const apiUrl = useApiUrl(); const { saveButtonProps, - refineCore: { queryResult }, + refineCore: { query: queryResult }, register, control, formState: { errors }, diff --git a/examples/win95/src/routes/video-club/members/edit.tsx b/examples/win95/src/routes/video-club/members/edit.tsx index 6b6b8609f441..1fdff3b1a1e3 100644 --- a/examples/win95/src/routes/video-club/members/edit.tsx +++ b/examples/win95/src/routes/video-club/members/edit.tsx @@ -19,7 +19,7 @@ export const VideoClubMemberPageEdit = () => { const { control, - refineCore: { onFinish, queryResult }, + refineCore: { onFinish, query: queryResult }, handleSubmit, } = useForm(); diff --git a/examples/with-custom-pages/src/pages/posts/edit.tsx b/examples/with-custom-pages/src/pages/posts/edit.tsx index a7ac2428084d..d160dc4d3a62 100644 --- a/examples/with-custom-pages/src/pages/posts/edit.tsx +++ b/examples/with-custom-pages/src/pages/posts/edit.tsx @@ -9,7 +9,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost, ICategory } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/with-javascript/src/pages/posts/edit.jsx b/examples/with-javascript/src/pages/posts/edit.jsx index c8b28bffbcfd..ad97cd28d37b 100644 --- a/examples/with-javascript/src/pages/posts/edit.jsx +++ b/examples/with-javascript/src/pages/posts/edit.jsx @@ -6,7 +6,7 @@ import { Form, Input, Select } from "antd"; import MDEditor from "@uiw/react-md-editor"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const postData = queryResult?.data?.data; const { selectProps: categorySelectProps } = useSelect({ diff --git a/examples/with-material-ui-vite/src/pages/blog-posts/edit.tsx b/examples/with-material-ui-vite/src/pages/blog-posts/edit.tsx index 931e44c36e1e..00e5de357399 100644 --- a/examples/with-material-ui-vite/src/pages/blog-posts/edit.tsx +++ b/examples/with-material-ui-vite/src/pages/blog-posts/edit.tsx @@ -7,7 +7,7 @@ import { Controller } from "react-hook-form"; export const BlogPostEdit = () => { const { saveButtonProps, - refineCore: { queryResult, formLoading }, + refineCore: { query: queryResult, formLoading }, register, control, formState: { errors }, diff --git a/examples/with-nextjs-next-auth/src/app/blog-posts/edit/[id]/page.tsx b/examples/with-nextjs-next-auth/src/app/blog-posts/edit/[id]/page.tsx index 93a95526fcfc..f679935a5698 100644 --- a/examples/with-nextjs-next-auth/src/app/blog-posts/edit/[id]/page.tsx +++ b/examples/with-nextjs-next-auth/src/app/blog-posts/edit/[id]/page.tsx @@ -4,7 +4,7 @@ import { Edit, useForm, useSelect } from "@refinedev/antd"; import { Form, Input, Select } from "antd"; export default function BlogPostEdit() { - const { formProps, saveButtonProps, queryResult } = useForm({}); + const { formProps, saveButtonProps, query: queryResult } = useForm({}); const blogPostsData = queryResult?.data?.data; diff --git a/examples/with-nextjs/src/app/blog-posts/edit/[id]/page.tsx b/examples/with-nextjs/src/app/blog-posts/edit/[id]/page.tsx index 93a95526fcfc..f679935a5698 100644 --- a/examples/with-nextjs/src/app/blog-posts/edit/[id]/page.tsx +++ b/examples/with-nextjs/src/app/blog-posts/edit/[id]/page.tsx @@ -4,7 +4,7 @@ import { Edit, useForm, useSelect } from "@refinedev/antd"; import { Form, Input, Select } from "antd"; export default function BlogPostEdit() { - const { formProps, saveButtonProps, queryResult } = useForm({}); + const { formProps, saveButtonProps, query: queryResult } = useForm({}); const blogPostsData = queryResult?.data?.data; diff --git a/examples/with-persist-query/src/pages/posts/edit.tsx b/examples/with-persist-query/src/pages/posts/edit.tsx index bda14afb70d7..eceb19d84a2a 100644 --- a/examples/with-persist-query/src/pages/posts/edit.tsx +++ b/examples/with-persist-query/src/pages/posts/edit.tsx @@ -4,7 +4,7 @@ import { useSelect } from "@refinedev/core"; export const PostEdit: React.FC = () => { const { - refineCore: { onFinish, formLoading, queryResult }, + refineCore: { onFinish, formLoading, query: queryResult }, register, handleSubmit, resetField, diff --git a/examples/with-react-toastify/src/pages/posts/edit.tsx b/examples/with-react-toastify/src/pages/posts/edit.tsx index bda14afb70d7..eceb19d84a2a 100644 --- a/examples/with-react-toastify/src/pages/posts/edit.tsx +++ b/examples/with-react-toastify/src/pages/posts/edit.tsx @@ -4,7 +4,7 @@ import { useSelect } from "@refinedev/core"; export const PostEdit: React.FC = () => { const { - refineCore: { onFinish, formLoading, queryResult }, + refineCore: { onFinish, formLoading, query: queryResult }, register, handleSubmit, resetField, diff --git a/examples/with-remix-antd/app/routes/_protected.posts.edit.$id.tsx b/examples/with-remix-antd/app/routes/_protected.posts.edit.$id.tsx index 530a577166c5..24a7a50f055a 100644 --- a/examples/with-remix-antd/app/routes/_protected.posts.edit.$id.tsx +++ b/examples/with-remix-antd/app/routes/_protected.posts.edit.$id.tsx @@ -10,7 +10,11 @@ import type { IPost } from "../interfaces"; const PostEdit: React.FC = () => { const { initialData } = useLoaderData(); - const { formProps, saveButtonProps, queryResult } = useForm({ + const { + formProps, + saveButtonProps, + query: queryResult, + } = useForm({ queryOptions: { initialData, }, diff --git a/examples/with-remix-headless/app/pages/posts/edit.tsx b/examples/with-remix-headless/app/pages/posts/edit.tsx index f5ddeec59f2a..ff0f67a6ecee 100644 --- a/examples/with-remix-headless/app/pages/posts/edit.tsx +++ b/examples/with-remix-headless/app/pages/posts/edit.tsx @@ -4,7 +4,7 @@ import { useSelect } from "@refinedev/core"; export const PostEdit: React.FC = () => { const { - refineCore: { onFinish, formLoading, queryResult }, + refineCore: { onFinish, formLoading, query: queryResult }, register, handleSubmit, resetField, diff --git a/examples/with-remix-headless/app/routes/_protected.posts.edit.$id.tsx b/examples/with-remix-headless/app/routes/_protected.posts.edit.$id.tsx index 57a86a2f7409..83e8b2c34e27 100644 --- a/examples/with-remix-headless/app/routes/_protected.posts.edit.$id.tsx +++ b/examples/with-remix-headless/app/routes/_protected.posts.edit.$id.tsx @@ -12,7 +12,7 @@ const PostEdit: React.FC = () => { const { initialData } = useLoaderData(); const { - refineCore: { onFinish, formLoading, queryResult }, + refineCore: { onFinish, formLoading, query: queryResult }, register, handleSubmit, resetField, diff --git a/examples/with-remix-vite-headless/app/pages/posts/edit.tsx b/examples/with-remix-vite-headless/app/pages/posts/edit.tsx index f5ddeec59f2a..ff0f67a6ecee 100644 --- a/examples/with-remix-vite-headless/app/pages/posts/edit.tsx +++ b/examples/with-remix-vite-headless/app/pages/posts/edit.tsx @@ -4,7 +4,7 @@ import { useSelect } from "@refinedev/core"; export const PostEdit: React.FC = () => { const { - refineCore: { onFinish, formLoading, queryResult }, + refineCore: { onFinish, formLoading, query: queryResult }, register, handleSubmit, resetField, diff --git a/examples/with-remix-vite-headless/app/routes/_protected.posts.edit.$id.tsx b/examples/with-remix-vite-headless/app/routes/_protected.posts.edit.$id.tsx index 57a86a2f7409..83e8b2c34e27 100644 --- a/examples/with-remix-vite-headless/app/routes/_protected.posts.edit.$id.tsx +++ b/examples/with-remix-vite-headless/app/routes/_protected.posts.edit.$id.tsx @@ -12,7 +12,7 @@ const PostEdit: React.FC = () => { const { initialData } = useLoaderData(); const { - refineCore: { onFinish, formLoading, queryResult }, + refineCore: { onFinish, formLoading, query: queryResult }, register, handleSubmit, resetField, diff --git a/examples/with-web3/src/pages/posts/edit.tsx b/examples/with-web3/src/pages/posts/edit.tsx index d83eb326e4e4..0b4e0944923e 100644 --- a/examples/with-web3/src/pages/posts/edit.tsx +++ b/examples/with-web3/src/pages/posts/edit.tsx @@ -8,7 +8,7 @@ import MDEditor from "@uiw/react-md-editor"; import type { IPost } from "../../interfaces"; export const PostEdit = () => { - const { formProps, saveButtonProps, queryResult } = useForm(); + const { formProps, saveButtonProps, query: queryResult } = useForm(); const { selectProps: categorySelectProps } = useSelect({ resource: "categories",