-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create fech team members action and team reducer
Relates #43
- Loading branch information
1 parent
f5ea1b1
commit ecb097f
Showing
5 changed files
with
56 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import axios from 'axios'; | ||
import { GET_TEAM_MEMBERS } from '../constants/actionTypes'; | ||
|
||
export default teamId => dispatch => { | ||
axios.get(`/teams/${teamId}/members`).then(({ data }) => | ||
dispatch({ | ||
type: GET_TEAM_MEMBERS, | ||
data, | ||
}) | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const GET_TEAM_MEMBERS = 'GET_TEAM_MEMBERS'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import { combineReducers } from 'redux'; | ||
|
||
import userReducer from './users'; | ||
import teamReducer from './teams'; | ||
|
||
const appReducer = combineReducers({ | ||
users: userReducer, | ||
team: teamReducer, | ||
}); | ||
|
||
export default appReducer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { GET_TEAM_MEMBERS } from '../constants/actionTypes'; | ||
|
||
const initialState = { | ||
members: [], | ||
}; | ||
|
||
const teamsReducer = (state = initialState, action) => { | ||
return state; | ||
}; | ||
export default teamsReducer; |