(userId)
| 57 | |
| 58 | // Get profile by ID |
| 59 | export 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 |
| 76 | export const getGithubRepos = (username) => async (dispatch) => { |