MCPcopy Create free account
hub / github.com/codemistic/Web-Development / createPost

Function createPost

project_mern_memories/client/src/actions/posts.js:15–23  ·  view source on GitHub ↗
(post)

Source from the content-addressed store, hash-verified

13};
14
15export const createPost = (post) => async (dispatch) => {
16 try {
17 const { data } = await api.createPost(post);
18
19 dispatch({ type: CREATE, payload: data });
20 } catch (error) {
21 console.log(error.message);
22 }
23};
24
25export const updatePost = (id, post) => async (dispatch) => {
26 try {

Callers 1

handleSubmitFunction · 0.90

Calls 1

logMethod · 0.45

Tested by

no test coverage detected