Skip to content

Commit

Permalink
[UPDATE]: bug fix categories
Browse files Browse the repository at this point in the history
  • Loading branch information
mojtaba1180 committed May 31, 2023
1 parent d027844 commit 32b3f2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/pages/admin/categories/add.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ function CategoriesAdd() {
navigate("/admin/categories");
},
onError: (err) => {
message.error("مشکلی رخ داده است لطفا دقایقی دیگر تلاش کنید");
console.log(err);
}
}
Expand Down Expand Up @@ -80,6 +81,7 @@ function CategoriesAdd() {

<Button
type="primary"
loading={mutation.isLoading}
disabled={mutation.isLoading}
style={{ width: "100%" }}
size="large"
Expand Down
10 changes: 7 additions & 3 deletions src/pages/admin/categories/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@ function List() {
message.success("دسته بندی حذف شد");
refetch();
},
onError: () => {
message.error("حذف با مشکل مواجه شد");
refetch();
onError: (err) => {
if (err.response.status !== 404) {
message.error("حذف با مشکل مواجه شد");
refetch();
} else {
window.location.reload();
}
}
}
);
Expand Down

0 comments on commit 32b3f2f

Please sign in to comment.