mirror of
https://github.com/wassname/talk.git
synced 2026-07-13 15:20:31 +08:00
26 lines
547 B
JavaScript
26 lines
547 B
JavaScript
import {Map} from 'immutable';
|
|
import * as actions from '../constants/asset';
|
|
|
|
const initialState = Map({
|
|
closedAt: null,
|
|
settings: null,
|
|
title: null,
|
|
url: null,
|
|
features: Map({}),
|
|
status: 'open',
|
|
moderation: null
|
|
});
|
|
|
|
export default function asset (state = initialState, action) {
|
|
switch (action.type) {
|
|
case actions.FETCH_ASSET_SUCCESS:
|
|
return state
|
|
.merge(action.asset);
|
|
case actions.UPDATE_ASSET_SETTINGS_SUCCESS:
|
|
return state
|
|
.setIn(['settings'], action.settings);
|
|
default:
|
|
return state;
|
|
}
|
|
}
|