Changeset 4d97b63 for jobvista-frontend/src/redux/reducers
Legend:
- Unmodified
- Added
- Removed
-
jobvista-frontend/src/redux/reducers/applicationReducer.js
r0f0add0 r4d97b63 2 2 CURRENT_USER, 3 3 FETCH_APPLICATIONS_BY_JOB_ID, 4 FETCH_APPLICATIONS_BY_JOB_SEEKER_ID, 5 SUBMIT_APPLICATION, UPDATE_APPLICATION _STATUS4 FETCH_APPLICATIONS_BY_JOB_SEEKER_ID, FILTER_APPLICATIONS_BY_JOB_ID, FILTER_APPLICATIONS_BY_JOB_SEEKER_ID, 5 SUBMIT_APPLICATION, UPDATE_APPLICATION, UPDATE_APPLICATION_STATUS 6 6 } from "../actionTypes"; 7 7 … … 22 22 applicationsByJobSeeker: [...state.applicationsByJobSeeker, action.application] 23 23 } 24 case UPDATE_APPLICATION: 25 return { 26 ...state, 27 applicationsByJobSeeker: state.applicationsByJobSeeker.map(application => 28 application.id === action.application.id ? 29 action.application : // Replace with the updated application 30 application // Keep the old one 31 ) 32 } 24 33 case UPDATE_APPLICATION_STATUS: 25 34 return { … … 36 45 applicationsByJobAdId: action.applicationsByJobAdId 37 46 } 47 case FILTER_APPLICATIONS_BY_JOB_ID: 48 return { 49 ...state, 50 applicationsByJobAdId: action.applicationsByJobAdId 51 } 52 38 53 case FETCH_APPLICATIONS_BY_JOB_SEEKER_ID: 54 return { 55 ...state, 56 applicationsByJobSeeker: action.applicationsByJobSeeker 57 } 58 case FILTER_APPLICATIONS_BY_JOB_SEEKER_ID: 39 59 return { 40 60 ...state,
Note:
See TracChangeset
for help on using the changeset viewer.