aboutsummaryrefslogtreecommitdiff
path: root/src/store/reducers/userSocialsReducer.ts
blob: 1186fa80c0e2be551502e3a17e21e993cf29355c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import {createSlice} from '@reduxjs/toolkit';
import {NO_SOCIALS} from '../initialStates';

const userSocialsSlice = createSlice({
  name: 'userSocials',
  initialState: NO_SOCIALS,
  reducers: {
    individualSocialfetched: (state, actions) => {
      state.socialAccounts[actions.payload.socialType] = actions.payload.social;
    },
    userSocialsFetched: (state, action) => {
      state.socialAccounts = action.payload;
    },
  },
});

export const {userSocialsFetched, individualSocialfetched} =
  userSocialsSlice.actions;
export const userSocialsReducer = userSocialsSlice.reducer;