[BUG]If an error is returned from the RestAPI, the input is in progress.
See original GitHub issueSorry if this isn’t a bug.
Describe the bug https://refine.dev/docs/ui-frameworks/antd/tutorial/#editing-a-record When an error is returned from RestAPI (e.g. http status 422), the data being input is reset. Please provide a workaround for this.
This is a program I created.
import { useForm, Form, Input, Edit } from "@pankod/refine-antd";
import { HttpError, useTranslate } from "@pankod/refine-core";
import { IAdmin } from "interfaces/admin";
export const AdminEdit: React.FC = () => {
const { formProps, saveButtonProps, queryResult } = useForm<
IAdmin,
HttpError
>();
const translate = useTranslate();
return (
<Edit saveButtonProps={saveButtonProps}>
<Form {...formProps} layout="vertical">
<Form.Item label={translate("admins.fields.name")} name="name">
<Input />
</Form.Item>
<Form.Item label={translate("admins.fields.email")} name="email">
<Input />
</Form.Item>
<Form.Item label={translate("admins.fields.password")} name="password">
<Input />
</Form.Item>
</Form>
</Edit>
);
};
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
REST API issue/question: I am getting an error stating " JSON
Solved: Trying to run a RESST API command. When in the REST setup all is working correctly. However, once I set up to...
Read more >REST API error code 500 handling - Stack Overflow
It is a server error, not a client error. If server errors weren't to be returned to the client, there wouldn't have been...
Read more >Resolve API Gateway REST API 403 “Missing Authentication ...
API Gateway REST API endpoints return Missing Authentication Token errors for the following reasons: The API request is made to a method or ......
Read more >REST API error codes - DocuSign Developers
Lists the error codes used by the eSignature REST API. ... The DocuSign REST APIs return either 200 (OK) or 201 (Created) when...
Read more >Common REST API error codes - Azure Storage
Error code HTTP status code User message
AccountAlreadyExists Conflict (409) The specified account already exists.
AccountIsDisabled Forbidden (403) The specified account is disabled.
AccountProtectedFromDeletion Conflict (409)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://user-images.githubusercontent.com/4780752/164268836-fd83f71b-8898-4d71-b11c-e9597938abe9.mov
Procedure.
I expect that the value will not be cleared in 5.
@omeraplak It worked as expected. Thank you.