Changeset 19398ad for jobvista-frontend/src/redux
- Timestamp:
- 05/16/24 23:09:21 (6 months ago)
- Branches:
- main
- Children:
- 28b3398
- Parents:
- d8b6c91
- Location:
- jobvista-frontend/src/redux
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
jobvista-frontend/src/redux/actionTypes.js
rd8b6c91 r19398ad 4 4 export const UPDATE_TOKEN = "UPDATE_TOKEN" 5 5 export const CURRENT_USER = "CURRENT_USER" 6 7 export const ADD_JOB_ADVERTISEMENT = "ADD_JOB_ADVERTISEMENT" 8 export const EDIT_JOB_ADVERTISEMENT = "EDIT_JOB_ADVERTISEMENT" 9 export const DELETE_JOB_ADVERTISEMENT = "DELETE_JOB_ADVERTISEMENT" 10 export const FETCH_JOB_ADVERTISEMENTS = "FETCH_JOB_ADVERTISEMENTS" 11 export const FETCH_JOB_ADVERTISEMENTS_BY_RECRUITER = "FETCH_JOB_ADVERTISEMENTS_BY_RECRUITER" -
jobvista-frontend/src/redux/actions/authActions.js
rd8b6c91 r19398ad 43 43 const response = jwtResponse.data; 44 44 const token = response.token; 45 //const refreshToken = response.refreshToken; // Corrected typo45 //const refreshToken = response.refreshToken; 46 46 const user = { 47 id: response.id, 47 48 email: response.email, 48 49 name: response.name, -
jobvista-frontend/src/redux/reducers/authReducer.js
rd8b6c91 r19398ad 21 21 case UPDATE_TOKEN: 22 22 let token = action.payload; 23 let currentUser = null23 let currentUser = ""; 24 24 if(!isExpired(token)) { 25 25 localStorage.setItem(AUTH_TOKEN, token); … … 37 37 }; 38 38 case SIGN_OUT: 39 console.log("BRISAM")40 39 localStorage.removeItem(CURRENT_USER); 41 40 localStorage.removeItem(AUTH_TOKEN); 42 41 return { 43 42 ...state, 44 currentUser: null,45 token: null43 currentUser: "", 44 token: "", 46 45 } 47 46 -
jobvista-frontend/src/redux/store.js
rd8b6c91 r19398ad 2 2 import { combineReducers } from 'redux'; 3 3 import authReducer from "./reducers/authReducer"; 4 import { thunk } from 'redux-thunk';4 import jobAdReducer from "./reducers/jobAdvertisementReducer"; 5 5 6 6 // const rootReducer = combineReducers({ … … 15 15 export const store = configureStore({ 16 16 reducer: { 17 auth: authReducer 17 auth: authReducer, 18 jobAd: jobAdReducer 18 19 }, 19 20 });
Note:
See TracChangeset
for help on using the changeset viewer.