Changeset 28b3398 for jobvista-frontend/src/redux/actions
- Timestamp:
- 06/09/24 14:24:03 (5 months ago)
- Branches:
- main
- Children:
- b248810
- Parents:
- 19398ad
- Location:
- jobvista-frontend/src/redux/actions
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.