Changeset b248810 for jobvista-frontend/src/redux/reducers
- Timestamp:
- 06/10/24 22:34:32 (5 months ago)
- Branches:
- main
- Children:
- befb988
- Parents:
- 28b3398
- Location:
- jobvista-frontend/src/redux/reducers
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
jobvista-frontend/src/redux/reducers/jobAdvertisementReducer.js
r28b3398 rb248810 5 5 FETCH_JOB_ADVERTISEMENTS_BY_RECRUITER, FILTER_JOB_ADVERTISEMENTS, FILTER_JOB_ADVERTISEMENTS_BY_RECRUITER 6 6 } from "../actionTypes"; 7 import {sortElementsBy DateCreated} from "../../utils/utils";7 import {sortElementsBy} from "../../utils/utils"; 8 8 import {useSelector} from "react-redux"; 9 9 … … 22 22 return { 23 23 ...state, 24 jobAdvertisements: sortElementsBy DateCreated([...state.jobAdvertisements, action.jobAdvertisement]),25 jobAdvertisementsByRecruiter: sortElementsBy DateCreated([...state.jobAdvertisementsByRecruiter, action.jobAdvertisement])24 jobAdvertisements: sortElementsBy([...state.jobAdvertisements, action.jobAdvertisement]), 25 jobAdvertisementsByRecruiter: sortElementsBy([...state.jobAdvertisementsByRecruiter, action.jobAdvertisement], "postedOn") 26 26 } 27 27 case EDIT_JOB_ADVERTISEMENT: … … 30 30 31 31 return { 32 jobAdvertisements: sortElementsBy DateCreated([...jobAdvertisements, action.jobAdvertisement]),33 jobAdvertisementsByRecruiter: sortElementsBy DateCreated([...jobAdvertisementsByRecruiter, action.jobAdvertisement])32 jobAdvertisements: sortElementsBy([...jobAdvertisements, action.jobAdvertisement], "postedOn"), 33 jobAdvertisementsByRecruiter: sortElementsBy([...jobAdvertisementsByRecruiter, action.jobAdvertisement], "postedOn") 34 34 } 35 35 case DELETE_JOB_ADVERTISEMENT: … … 38 38 39 39 return { 40 jobAdvertisements: sortElementsBy DateCreated([...jobAdvertisements]),41 jobAdvertisementsByRecruiter: sortElementsBy DateCreated([...jobAdvertisementsByRecruiter])40 jobAdvertisements: sortElementsBy([...jobAdvertisements], "postedOn"), 41 jobAdvertisementsByRecruiter: sortElementsBy([...jobAdvertisementsByRecruiter], "postedOn") 42 42 } 43 43 … … 45 45 return { 46 46 ...state, 47 jobAdvertisements: sortElementsBy DateCreated(action.jobAdvertisements)47 jobAdvertisements: sortElementsBy(action.jobAdvertisements, "postedOn") 48 48 } 49 49 … … 52 52 return { 53 53 ...state, 54 jobAdvertisementsByRecruiter: sortElementsBy DateCreated(action.jobAdvertisementsByRecruiter)54 jobAdvertisementsByRecruiter: sortElementsBy(action.jobAdvertisementsByRecruiter, "postedOn") 55 55 } 56 56
Note:
See TracChangeset
for help on using the changeset viewer.