Ignore:
Timestamp:
06/10/24 22:34:32 (5 months ago)
Author:
223021 <daniel.ilievski.2@…>
Branches:
main
Children:
befb988
Parents:
28b3398
Message:

Added no access page for new recruiters and admin panel for granting access

Location:
jobvista-frontend/src/redux
Files:
2 added
4 edited

Legend:

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

    r28b3398 rb248810  
    1818export const DOWNLOAD_RESUME = "DOWNLOAD_RESUME"
    1919
     20export const FETCH_RECRUITERS = "FETCH_RECRUITERS"
     21export const CHANGE_ACCESS = "CHANGE_ACCESS"
    2022
     23
  • jobvista-frontend/src/redux/actions/authActions.js

    r28b3398 rb248810  
    4848                    email: response.email,
    4949                    name: response.name,
    50                     role: response.role
     50                    role: response.role,
     51                    access: response.hasAccess,
    5152                };
    5253                dispatch({
  • jobvista-frontend/src/redux/reducers/jobAdvertisementReducer.js

    r28b3398 rb248810  
    55    FETCH_JOB_ADVERTISEMENTS_BY_RECRUITER, FILTER_JOB_ADVERTISEMENTS, FILTER_JOB_ADVERTISEMENTS_BY_RECRUITER
    66} from "../actionTypes";
    7 import {sortElementsByDateCreated} from "../../utils/utils";
     7import {sortElementsBy} from "../../utils/utils";
    88import {useSelector} from "react-redux";
    99
     
    2222            return {
    2323                ...state,
    24                 jobAdvertisements: sortElementsByDateCreated([...state.jobAdvertisements, action.jobAdvertisement]),
    25                 jobAdvertisementsByRecruiter: sortElementsByDateCreated([...state.jobAdvertisementsByRecruiter, action.jobAdvertisement])
     24                jobAdvertisements: sortElementsBy([...state.jobAdvertisements, action.jobAdvertisement]),
     25                jobAdvertisementsByRecruiter: sortElementsBy([...state.jobAdvertisementsByRecruiter, action.jobAdvertisement], "postedOn")
    2626            }
    2727        case EDIT_JOB_ADVERTISEMENT:
     
    3030
    3131            return {
    32                 jobAdvertisements: sortElementsByDateCreated([...jobAdvertisements, action.jobAdvertisement]),
    33                 jobAdvertisementsByRecruiter: sortElementsByDateCreated([...jobAdvertisementsByRecruiter, action.jobAdvertisement])
     32                jobAdvertisements: sortElementsBy([...jobAdvertisements, action.jobAdvertisement], "postedOn"),
     33                jobAdvertisementsByRecruiter: sortElementsBy([...jobAdvertisementsByRecruiter, action.jobAdvertisement], "postedOn")
    3434            }
    3535        case DELETE_JOB_ADVERTISEMENT:
     
    3838
    3939            return {
    40                 jobAdvertisements: sortElementsByDateCreated([...jobAdvertisements]),
    41                 jobAdvertisementsByRecruiter: sortElementsByDateCreated([...jobAdvertisementsByRecruiter])
     40                jobAdvertisements: sortElementsBy([...jobAdvertisements], "postedOn"),
     41                jobAdvertisementsByRecruiter: sortElementsBy([...jobAdvertisementsByRecruiter], "postedOn")
    4242            }
    4343
     
    4545            return {
    4646                ...state,
    47                 jobAdvertisements: sortElementsByDateCreated(action.jobAdvertisements)
     47                jobAdvertisements: sortElementsBy(action.jobAdvertisements, "postedOn")
    4848            }
    4949
     
    5252            return {
    5353                ...state,
    54                 jobAdvertisementsByRecruiter: sortElementsByDateCreated(action.jobAdvertisementsByRecruiter)
     54                jobAdvertisementsByRecruiter: sortElementsBy(action.jobAdvertisementsByRecruiter, "postedOn")
    5555            }
    5656
  • jobvista-frontend/src/redux/store.js

    r28b3398 rb248810  
    44import jobAdReducer from "./reducers/jobAdvertisementReducer";
    55import applicationReducer from "./reducers/applicationReducer"
     6import adminReducer from "./reducers/adminReducer"
     7import {AdminActions} from "./actions/adminActions";
    68
    79// const rootReducer = combineReducers({
     
    1820        auth: authReducer,
    1921        jobAd: jobAdReducer,
    20         appl: applicationReducer
     22        appl: applicationReducer,
     23        admin: adminReducer
    2124    },
    2225});
Note: See TracChangeset for help on using the changeset viewer.