Skip to content

Commit

Permalink
fix(examples): remove debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
alicanerdurmaz committed Jul 23, 2024
1 parent eeed7bb commit 7977818
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions examples/base-antd/src/pages/posts/edit.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Edit, useEditableTable, useForm, useSelect } from "@refinedev/antd";
import { useForm as useFormCore, useShow, useTable } from "@refinedev/core";
import React from "react";
import { Edit, useForm, useSelect } from "@refinedev/antd";

import { Form, Input, Select } from "antd";

Expand All @@ -8,33 +8,14 @@ import MDEditor from "@uiw/react-md-editor";
import type { IPost, ICategory } from "../../interfaces";

export const PostEdit = () => {
const {
queryResult: queryResultCore,
mutationResult: mutationResultCore,
mutation: mutationCore,
query: queryCore,
} = useFormCore();
const { queryResult: queryResultShow } = useShow();
const { queryResult: queryResultShowSelect, defaultValueQueryResult } =
useSelect({ resource: "" });
const { tableQueryResult } = useTable();

// const { queryResult,query } = useEditableTable();

const {
formProps,
saveButtonProps,
queryResult,
mutationResult,
autoSaveProps,
} = useForm<IPost>({
const { formProps, saveButtonProps, query, autoSaveProps } = useForm<IPost>({
warnWhenUnsavedChanges: true,
autoSave: {
enabled: true,
},
});

const postData = queryResult?.data?.data;
const postData = query?.data?.data;
const { selectProps: categorySelectProps } = useSelect<ICategory>({
resource: "categories",
defaultValue: postData?.category.id,
Expand Down

0 comments on commit 7977818

Please sign in to comment.