Added link/PreviewCard search to search
• Added: - link/PreviewCard search to search
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
LINK_FETCH_REQUEST,
|
||||
LINK_FETCH_SUCCESS,
|
||||
LINK_FETCH_FAIL,
|
||||
IMPORT_LINK_CARDS,
|
||||
} from '../actions/links'
|
||||
|
||||
const initialState = ImmutableMap({
|
||||
@@ -27,6 +28,13 @@ export default function links(state = initialState, action) {
|
||||
mutable.set('isFetched', false)
|
||||
mutable.set('isError', false)
|
||||
})
|
||||
case IMPORT_LINK_CARDS:
|
||||
return state.withMutations((mutable) => {
|
||||
action.cards.forEach((card) => mutable.setIn(['items', `${card.id}`], fromJS(card)))
|
||||
mutable.set('isLoading', false)
|
||||
mutable.set('isFetched', false)
|
||||
mutable.set('isError', false)
|
||||
})
|
||||
case LINK_FETCH_FAIL:
|
||||
return state.withMutations((mutable) => {
|
||||
mutable.set('isLoading', false)
|
||||
|
||||
Reference in New Issue
Block a user