123456789101112131415161718192021222324252627 |
- import { CONTENT_TYPE_LIST } from '../action-creator.sync.js'
-
- export function contentType (state = [], action) {
- switch (action.type) {
- case `Set/${CONTENT_TYPE_LIST}`:
- return action.contentTypeList.map(ct => ({
- label: ct.label,
- slug: ct.slug,
- faIcon: ct.fa_icon,
- hexcolor: ct.hexcolor,
- creationLabel: ct.creation_label,
- availableStatuses: ct.available_statuses.map(as => ({
- label: as.label,
- slug: as.slug,
- fa_icon: as.fa_icon,
- hexcolor: as.hexcolor,
- global_status: as.global_status
- }))
- }))
-
- default:
- return state
- }
- }
-
- export default contentType
|