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
Files:
2 added
4 edited

Legend:

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

    r19398ad r28b3398  
    99export const DELETE_JOB_ADVERTISEMENT = "DELETE_JOB_ADVERTISEMENT"
    1010export const FETCH_JOB_ADVERTISEMENTS = "FETCH_JOB_ADVERTISEMENTS"
     11export const FILTER_JOB_ADVERTISEMENTS = "FILTER_JOB_ADVERTISEMENTS"
    1112export const FETCH_JOB_ADVERTISEMENTS_BY_RECRUITER = "FETCH_JOB_ADVERTISEMENTS_BY_RECRUITER"
     13export const FILTER_JOB_ADVERTISEMENTS_BY_RECRUITER = "FILTER_JOB_ADVERTISEMENTS_BY_RECRUITER"
     14export const SUBMIT_APPLICATION = "SUBMIT_APPLICATION"
     15export const UPDATE_APPLICATION_STATUS = "UPDATE_APPLICATION_STATUS"
     16export const FETCH_APPLICATIONS_BY_JOB_ID = "FETCH_APPLICATIONS_BY_JOB_ID"
     17export const FETCH_APPLICATIONS_BY_JOB_SEEKER_ID = "FETCH_APPLICATIONS_BY_JOB_SEEKER_ID"
     18export const DOWNLOAD_RESUME = "DOWNLOAD_RESUME"
     19
     20
  • 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
  • jobvista-frontend/src/redux/reducers/jobAdvertisementReducer.js

    r19398ad r28b3398  
    33    CURRENT_USER, DELETE_JOB_ADVERTISEMENT, EDIT_JOB_ADVERTISEMENT,
    44    FETCH_JOB_ADVERTISEMENTS,
    5     FETCH_JOB_ADVERTISEMENTS_BY_RECRUITER
     5    FETCH_JOB_ADVERTISEMENTS_BY_RECRUITER, FILTER_JOB_ADVERTISEMENTS, FILTER_JOB_ADVERTISEMENTS_BY_RECRUITER
    66} from "../actionTypes";
    77import {sortElementsByDateCreated} from "../../utils/utils";
     
    4848            }
    4949
     50
    5051        case FETCH_JOB_ADVERTISEMENTS_BY_RECRUITER:
    5152            return {
  • jobvista-frontend/src/redux/store.js

    r19398ad r28b3398  
    33import authReducer from "./reducers/authReducer";
    44import jobAdReducer from "./reducers/jobAdvertisementReducer";
     5import applicationReducer from "./reducers/applicationReducer"
    56
    67// const rootReducer = combineReducers({
     
    1617    reducer: {
    1718        auth: authReducer,
    18         jobAd: jobAdReducer
     19        jobAd: jobAdReducer,
     20        appl: applicationReducer
    1921    },
    2022});
Note: See TracChangeset for help on using the changeset viewer.