Filtre des tickets par jalons

This commit is contained in:
2021-03-19 18:15:40 +01:00
parent 6bb8afd914
commit 6ffb2915bf
12 changed files with 9933 additions and 119 deletions

View File

@ -1,13 +1,18 @@
import { FETCH_PROJECTS_SUCCESS } from "../actions/projects";
import { FETCH_PROJECTS_SUCCESS, FETCH_PROJECT_MILESTONES_SUCCESS } from "../actions/projects";
export const defaultState = {
byName: {},
milestones: ""
};
export function projectsReducer(state = defaultState, action: any) {
switch(action.type) {
switch (action.type) {
case FETCH_PROJECTS_SUCCESS:
return handleFetchProjectsSuccess(state, action);
case FETCH_PROJECT_MILESTONES_SUCCESS:
return handleFetchProjectMilestonesSuccess(state, action);
default:
return state;
}
@ -24,4 +29,11 @@ function handleFetchProjectsSuccess(state: any, action: any) {
...projectsByName,
}
};
}
function handleFetchProjectMilestonesSuccess(state: any, action: any) {
return {
...state,
milestones: action.milestones,
};
}