8000 updated · wpcodevo/trpc-react-node-mongodb@91f863b · GitHub
[go: up one dir, main page]

Skip to content

Commit 91f863b

Browse files
committed
updated
1 parent c4facd8 commit 91f863b

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ const CreatePost: FC<ICreatePostProp> = ({ setOpenPostModal }) => {
4040
onError(error: any) {
4141
store.setPageLoading(false);
4242
setOpenPostModal(false);
43-
error.response.errors.forEach((err: any) => {
44-
toast(err.message, {
45-
type: "error",
46-
position: "top-right",
47-
});
43+
toast(error.message, {
44+
type: "error",
45+
position: "top-right",
4846
});
4947
},
5048
});

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ const PostItem: FC<PostItemProps> = ({ post }) => {
2929
},
3030
onError(error: any) {
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: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ const UpdatePost: FC<IUpdatePostProps> = ({ post, setOpenPostModal }) => {
4242
onError(error: any) {
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
});

0 commit comments

Comments
 (0)
0