Changeset 28b3398 for jobvista-frontend/src/redux
- Timestamp:
- 06/09/24 14:24:03 (5 months ago)
- Branches:
- main
- Children:
- b248810
- Parents:
- 19398ad
- Location:
- jobvista-frontend/src/redux
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
jobvista-frontend/src/redux/actionTypes.js
r19398ad r28b3398 9 9 export const DELETE_JOB_ADVERTISEMENT = "DELETE_JOB_ADVERTISEMENT" 10 10 export const FETCH_JOB_ADVERTISEMENTS = "FETCH_JOB_ADVERTISEMENTS" 11 export const FILTER_JOB_ADVERTISEMENTS = "FILTER_JOB_ADVERTISEMENTS" 11 12 export const FETCH_JOB_ADVERTISEMENTS_BY_RECRUITER = "FETCH_JOB_ADVERTISEMENTS_BY_RECRUITER" 13 export const FILTER_JOB_ADVERTISEMENTS_BY_RECRUITER = "FILTER_JOB_ADVERTISEMENTS_BY_RECRUITER" 14 export const SUBMIT_APPLICATION = "SUBMIT_APPLICATION" 15 export const UPDATE_APPLICATION_STATUS = "UPDATE_APPLICATION_STATUS" 16 export const FETCH_APPLICATIONS_BY_JOB_ID = "FETCH_APPLICATIONS_BY_JOB_ID" 17 export const FETCH_APPLICATIONS_BY_JOB_SEEKER_ID = "FETCH_APPLICATIONS_BY_JOB_SEEKER_ID" 18 export const DOWNLOAD_RESUME = "DOWNLOAD_RESUME" 19 20 -
jobvista-frontend/src/redux/actions/jobAdvertisementActions.js
r19398ad r28b3398 4 4 CURRENT_USER, DELETE_JOB_ADVERTISEMENT, EDIT_JOB_ADVERTISEMENT, 5 5 FETCH_JOB_ADVERTISEMENTS, 6 FETCH_JOB_ADVERTISEMENTS_BY_RECRUITER 6 FETCH_JOB_ADVERTISEMENTS_BY_RECRUITER, FILTER_JOB_ADVERTISEMENTS 7 7 } from "../actionTypes"; 8 8 … … 10 10 addJobAdvertisement: (jobAdvertisement, callback) => { 11 11 return dispatch => { 12 axios.post("/job-advertisements/add", jobAdvertisement) 12 axios.post("/job-advertisements/add", jobAdvertisement, { 13 headers: { 14 'Content-Type': 'application/json' 15 }, 16 }) 13 17 .then(response => { 14 18 dispatch({ … … 52 56 }, 53 57 fetchJobAdvertisementById: (id, callback) => { 54 axios.get("/job-advertisements/ view/" + id)58 axios.get("/job-advertisements/" + id) 55 59 .then(response => { 56 60 callback(true, response) 57 61 }).catch(error => { 58 59 62 callback(false, error) 63 }) 60 64 }, 61 65 … … 74 78 } 75 79 }, 80 filterJobAdvertisements: (filter, callback) => { 81 axios.post("/job-advertisements/filtered", filter) 82 .then(response => { 83 callback(true, response) 84 }).catch((error) => { 85 callback(false, error) }) 76 86 77 fetchJobAdvertisementsByRecruiter: (id, callback) => { 87 }, 88 89 fetchJobAdvertisementsByRecruiter: (callback) => { 78 90 return dispatch => { 79 91 let currentUser = JSON.parse(localStorage.getItem(CURRENT_USER)); … … 86 98 callback(true, response) 87 99 }).catch((error) => { 88 console.log("ERROR")89 100 callback(false, error) 90 101 }) 91 102 } 103 }, 104 105 filterJobAdvertisementsByRecruiter: (filter, callback) => { 106 107 let currentUser = JSON.parse(localStorage.getItem(CURRENT_USER)); 108 axios.post("/job-advertisements/recruiter/" + currentUser.id + "/filtered", filter) 109 .then(response => { 110 callback(true, response) 111 }).catch((error) => { 112 callback(false, error) 113 }) 114 92 115 }, 93 116 -
jobvista-frontend/src/redux/reducers/jobAdvertisementReducer.js
r19398ad r28b3398 3 3 CURRENT_USER, DELETE_JOB_ADVERTISEMENT, EDIT_JOB_ADVERTISEMENT, 4 4 FETCH_JOB_ADVERTISEMENTS, 5 FETCH_JOB_ADVERTISEMENTS_BY_RECRUITER 5 FETCH_JOB_ADVERTISEMENTS_BY_RECRUITER, FILTER_JOB_ADVERTISEMENTS, FILTER_JOB_ADVERTISEMENTS_BY_RECRUITER 6 6 } from "../actionTypes"; 7 7 import {sortElementsByDateCreated} from "../../utils/utils"; … … 48 48 } 49 49 50 50 51 case FETCH_JOB_ADVERTISEMENTS_BY_RECRUITER: 51 52 return { -
jobvista-frontend/src/redux/store.js
r19398ad r28b3398 3 3 import authReducer from "./reducers/authReducer"; 4 4 import jobAdReducer from "./reducers/jobAdvertisementReducer"; 5 import applicationReducer from "./reducers/applicationReducer" 5 6 6 7 // const rootReducer = combineReducers({ … … 16 17 reducer: { 17 18 auth: authReducer, 18 jobAd: jobAdReducer 19 jobAd: jobAdReducer, 20 appl: applicationReducer 19 21 }, 20 22 });
Note:
See TracChangeset
for help on using the changeset viewer.