main
Last change
on this file since 08f82ec was 08f82ec, checked in by 223021 <daniel.ilievski.2@…>, 4 months ago |
Did more refactoring
|
-
Property mode
set to
100644
|
File size:
805 bytes
|
Line | |
---|
1 | import {SET_LOGO_URL, SET_PROFILE_PIC_URL} from "../actionTypes";
|
---|
2 |
|
---|
3 | const initialState = {
|
---|
4 | profilePictures: {},
|
---|
5 | logos: {}
|
---|
6 | }
|
---|
7 |
|
---|
8 | const ImagesReducer = (state = initialState, action) => {
|
---|
9 |
|
---|
10 | switch (action.type) {
|
---|
11 | case SET_PROFILE_PIC_URL:
|
---|
12 | return{
|
---|
13 | ...state,
|
---|
14 | profilePictures: {
|
---|
15 | ...state.profilePictures, [action.payload.jobSeekerId]: action.payload.profilePicUrl
|
---|
16 | }
|
---|
17 | }
|
---|
18 | case SET_LOGO_URL:
|
---|
19 | return {
|
---|
20 | ...state,
|
---|
21 | logos: {
|
---|
22 | ...state.logos, [action.payload.recruiterId]: action.payload.logoUrl
|
---|
23 | }
|
---|
24 | }
|
---|
25 | default:
|
---|
26 | return {
|
---|
27 | ...state,
|
---|
28 | };
|
---|
29 | }
|
---|
30 | }
|
---|
31 |
|
---|
32 | export default ImagesReducer |
---|
Note:
See
TracBrowser
for help on using the repository browser.