Ignore:
Timestamp:
06/09/24 14:24:03 (5 months ago)
Author:
223021 <daniel.ilievski.2@…>
Branches:
main
Children:
b248810
Parents:
19398ad
Message:

Implemented job application functionality, added job advertisement filtering and replaced text areas with editors

Location:
jobvista-frontend/src/redux/actions
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • jobvista-frontend/src/redux/actions/jobAdvertisementActions.js

    r19398ad r28b3398  
    44    CURRENT_USER, DELETE_JOB_ADVERTISEMENT, EDIT_JOB_ADVERTISEMENT,
    55    FETCH_JOB_ADVERTISEMENTS,
    6     FETCH_JOB_ADVERTISEMENTS_BY_RECRUITER
     6    FETCH_JOB_ADVERTISEMENTS_BY_RECRUITER, FILTER_JOB_ADVERTISEMENTS
    77} from "../actionTypes";
    88
     
    1010    addJobAdvertisement: (jobAdvertisement, callback) => {
    1111        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            })
    1317                .then(response => {
    1418                    dispatch({
     
    5256    },
    5357    fetchJobAdvertisementById: (id, callback) => {
    54         axios.get("/job-advertisements/view/" + id)
     58        axios.get("/job-advertisements/" + id)
    5559            .then(response => {
    5660                callback(true, response)
    5761            }).catch(error => {
    58                 callback(false, error)
    59             })
     62            callback(false, error)
     63        })
    6064    },
    6165
     
    7478        }
    7579    },
     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)        })
    7686
    77     fetchJobAdvertisementsByRecruiter: (id, callback) => {
     87    },
     88
     89    fetchJobAdvertisementsByRecruiter: (callback) => {
    7890        return dispatch => {
    7991            let currentUser = JSON.parse(localStorage.getItem(CURRENT_USER));
     
    8698                    callback(true, response)
    8799                }).catch((error) => {
    88                 console.log("ERROR")
    89100                callback(false, error)
    90101            })
    91102        }
     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
    92115    },
    93116
Note: See TracChangeset for help on using the changeset viewer.