Skip to content

Commit de1dc09

Browse files
committed
updated
1 parent 67b2b88 commit de1dc09

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

packages/client/src/components/posts/post.component.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@ const PostItem: FC<PostItemProps> = ({ post }) => {
2727
position: "top-right",
2828
});
2929
},
30-
onError(error: any) {
30+
onError(error) {
3131
store.setPageLoading(false);
32-
error.response.errors.forEach((err: any) => {
33-
toast(err.message, {
34-
type: "error",
35-
position: "top-right",
36-
});
32+
toast(error.message, {
33+
type: "error",
34+
position: "top-right",
3735
});
3836
},
3937
});

packages/client/src/components/posts/update.post.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,12 @@ const UpdatePost: FC<IUpdatePostProps> = ({ post, setOpenPostModal }) => {
3939
position: "top-right",
4040
});
4141
},
42-
onError(error: any) {
42+
onError(error) {
4343
store.setPageLoading(false);
4444
setOpenPostModal(false);
45-
error.response.errors.forEach((err: any) => {
46-
toast(err.message, {
47-
type: "error",
48-
position: "top-right",
49-
});
45+
toast(error.message, {
46+
type: "error",
47+
position: "top-right",
5048
});
5149
},
5250
});

packages/client/src/pages/home.page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const HomePage = () => {
1919
onSuccess: (data) => {
2020
store.setPageLoading(false);
2121
},
22-
onError(error: any) {
22+
onError(error) {
2323
store.setPageLoading(false);
2424
toast(error.message, {
2525
type: "error",

0 commit comments

Comments
 (0)