Base changes to job upload screen.

This commit is contained in:
Patrick Fic
2022-05-04 18:13:58 -07:00
parent 865f4776d0
commit 5461aae6f6
14 changed files with 337 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
import MediaActionTypes from "./media.types";
const INITIAL_STATE = { error: null };
const mediaReducer = (state = INITIAL_STATE, action) => {
switch (action.type) {
case MediaActionTypes.SET_MEDIA_FOR_JOB:
return { ...state, [action.payload.jobid]: action.payload.media };
case MediaActionTypes.GET_MEDIA_FOR_JOB_ERROR:
return { ...state, error: action.payload };
case MediaActionTypes.ADD_MEDIA_FOR_JOB:
return {
...state,
[action.payload.jobid]: [
...state[action.payload.jobid],
...(action.payload.media || []),
],
};
default:
return state;
}
};
export default mediaReducer;