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

Function getPosts

project_mern_memories/client/src/actions/posts.js:5–13  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import * as api from '../api/index.js';
4
5export const getPosts = () => async (dispatch) => {
6 try {
7 const { data } = await api.fetchPosts();
8
9 dispatch({ type: FETCH_ALL, payload: data });
10 } catch (error) {
11 console.log(error.message);
12 }
13};
14
15export const createPost = (post) => async (dispatch) => {
16 try {

Callers 1

AppFunction · 0.90

Calls 1

logMethod · 0.45

Tested by

no test coverage detected