mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2026-03-10 21:25:04 +00:00
Liking posts with Redux and Material UI
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {SET_USER, SET_ERRORS, CLEAR_ERRORS, LOADING_UI, SET_AUTHENTICATED, SET_UNAUTHENTICATED} from '../types';
|
||||
import {SET_USER, SET_ERRORS, CLEAR_ERRORS, LOADING_UI, SET_AUTHENTICATED, SET_UNAUTHENTICATED, LIKE_POST, UNLIKE_POST, SET_LIKES} from '../types';
|
||||
|
||||
const initialState = {
|
||||
authenticated: false,
|
||||
@@ -19,9 +19,25 @@ export default function(state = initialState, action) {
|
||||
return initialState;
|
||||
case SET_USER:
|
||||
return {
|
||||
...state,
|
||||
authenticated: true,
|
||||
...action.payload,
|
||||
};
|
||||
case LIKE_POST:
|
||||
return {
|
||||
...state,
|
||||
...action.payload
|
||||
}
|
||||
case UNLIKE_POST:
|
||||
return {
|
||||
...state,
|
||||
...action.payload
|
||||
}
|
||||
case SET_LIKES:
|
||||
return {
|
||||
...state,
|
||||
...action.payload
|
||||
}
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user