MCPcopy
hub / github.com/bradtraversy/devconnector_2.0 / getProfileById

Function getProfileById

client/src/actions/profile.js:59–73  ·  view source on GitHub ↗
(userId)

Source from the content-addressed store, hash-verified

57
58// Get profile by ID
59export const getProfileById = (userId) => async (dispatch) => {
60 try {
61 const res = await api.get(`/profile/user/${userId}`);
62
63 dispatch({
64 type: GET_PROFILE,
65 payload: res.data
66 });
67 } catch (err) {
68 dispatch({
69 type: PROFILE_ERROR,
70 payload: { msg: err.response.statusText, status: err.response.status }
71 });
72 }
73};
74
75// Get Github repos
76export const getGithubRepos = (username) => async (dispatch) => {

Callers 1

Profile.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected