fix(dashboard): add error message in toaster on product delete (#13756)
* fix(dashboard): add error message in toaster on product delete * Create fuzzy-icons-hope.md * add description instead
This commit is contained in:
5
.changeset/fuzzy-icons-hope.md
Normal file
5
.changeset/fuzzy-icons-hope.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/dashboard": patch
|
||||
---
|
||||
|
||||
fix(dashboard): add error message in toaster on product delete
|
||||
@@ -1,6 +1,6 @@
|
||||
import { PencilSquare, Trash } from "@medusajs/icons"
|
||||
import { HttpTypes } from "@medusajs/types"
|
||||
import { Container, Heading, StatusBadge, usePrompt } from "@medusajs/ui"
|
||||
import { Container, Heading, StatusBadge, toast, usePrompt } from "@medusajs/ui"
|
||||
import { useTranslation } from "react-i18next"
|
||||
import { useNavigate } from "react-router-dom"
|
||||
|
||||
@@ -58,6 +58,11 @@ export const ProductGeneralSection = ({
|
||||
onSuccess: () => {
|
||||
navigate("..")
|
||||
},
|
||||
onError: (e) => {
|
||||
toast.error(t("products.toasts.delete.error.header"), {
|
||||
description: e.message,
|
||||
})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user