vanshaj2023 opened a new issue, #3356:
URL: https://github.com/apache/apisix-dashboard/issues/3356
### Issue description
Every create and update mutation across the entire dashboard has only an
`onSuccess` handler but no `onError` handler. When an API call fails (network
error, 403, 422, 500), the form silently stops responding the submit button
un-freezes and nothing happens. Users have no idea what went wrong.
**Example (routes/add.tsx:46):**
```ts
const postRoute = useMutation({
mutationFn: (d: RoutePostType) => postRouteReq(req, produceRoute(d)),
async onSuccess(res) {
notifications.show({ message: t('info.add.success', ...), color: 'green'
});
await navigate(res);
},
// missing: onError handler
});
```
### Expected behavior
When a create or update operation fails, an error notification should appear
informing the user that the operation was unsuccessful so they can retry or
investigate the issue.
### How to Reproduce
1. Navigate to any resource page (e.g. Routes, Services, Upstreams)
2. Fill in the form and click the Add/Save button
3. Simulate a failure disable network, or have the backend return a 500/403
4. Observe: the submit button un-freezes, nothing happens, no error message
shown
### Screenshots
_No response_
### Environment
- apisix version (cmd: `apisix version`):
- OS (cmd: `uname -a`):
- OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
- etcd version, if have (cmd: run `etcd --version`):
- apisix-dashboard version, if have:
- Browser version, if have:
### Additional context
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]