vanshaj2023 commented on issue #3343:
URL:
https://github.com/apache/apisix-dashboard/issues/3343#issuecomment-4114060933
Hi @Baoyuantop,
here's my plan to fix, adding a `.catch()` that shows an error notification:
```ts
.catch(() => {
notifications.show({
message: t('info.delete.error', { name }),
color: 'red',
});
})
```
A few questions I want to ask
1. Error message detail, should we show a generic "Delete failed" or extract
the error message from the API response (e.g. `error.response?.data?.message`)?
The API sometimes returns meaningful reasons like "resource is in use".
2. onSuccess failure, if onSuccess itself throws (e.g. a failed navigation),
should that also trigger the error notification, or only the DELETE request
failure?
3. i18n keys, I'll add `info.delete.error` across all 5 locales. Should the
wording be "Failed to delete {name}" or something else?
Happy to open a PR once we align on these!
--
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]