Commit bb4f5398 authored by Alf Eaton's avatar Alf Eaton
Browse files

Fix reducer export/import

parent 0afc8bcd
Pipeline #1083 failed with stage
in 2 minutes and 34 seconds
......@@ -17,7 +17,7 @@ import clone from 'lodash/clone'
import findIndex from 'lodash/findIndex'
import without from 'lodash/without'
export function collections (state = [], action) {
export default function (state = [], action) {
const collections = clone(state)
// TODO: store entities as an object or immutable Map, with the id as the key
......@@ -90,4 +90,4 @@ export function collections (state = [], action) {
}
return state
}
\ No newline at end of file
}
......@@ -4,7 +4,7 @@ import {
GET_USER_REQUEST, GET_USER_SUCCESS, GET_USER_FAILURE
} from '../actions/types'
export function currentUser (state = {
export default function (state = {
isFetching: false,
isAuthenticated: false,
token: token()
......
// Updates error message to notify about the failed fetches.
export default function (state = null, action) {
const {error} = action
if (error) {
console.log(error)
return error.message
} else {
return null
}
}
......@@ -3,7 +3,7 @@ import {
FILE_UPLOAD_SUCCESS,
} from '../actions/types'
export function fileUpload (state = {
export default function (state = {
isFetching: false
}, action) {
switch (action.type) {
......
......@@ -15,7 +15,7 @@ import clone from 'lodash/clone'
import assign from 'lodash/assign'
import unset from 'lodash/unset'
export function fragments (state = {}, action) {
export default function (state = {}, action) {
const fragments = clone(state)
function replaceAll () {
......
// Updates error message to notify about the failed fetches.
export function error (state = null, action) {
const { error } = action
if (error) {
console.log(error)
return error.message
} else {
return null
}
}
import { collections } from './collections'
import { fragments } from './fragments'
import error from './error'
import collections from './collections'
import fragments from './fragments'
import currentUser from './current_user'
import users from './users'
import teams from './teams'
import fileUpload from './fileUpload'
export { collections, fragments, currentUser, users, teams, fileUpload }
export default { error, collections, fragments, currentUser, users, teams, fileUpload }
......@@ -10,7 +10,7 @@ import findIndex from 'lodash/findIndex'
import assign from 'lodash/assign'
import difference from 'lodash/difference'
export function teams (state = [], action) {
export default function (state = [], action) {
const teams = clone(state)
function updateOne () {
......
......@@ -6,7 +6,7 @@ import {
} from '../actions/types'
// The users reducer.
export function users (state = {
export default function (state = {
isFetching: false
}, action) {
switch (action.type) {
......
......@@ -3,7 +3,7 @@ import { routerReducer, routerMiddleware } from 'react-router-redux'
import { browserHistory } from 'react-router'
import thunk from 'redux-thunk'
import * as reducers from '../reducers'
import reducers from '../reducers'
require('../components/reducers').forEach(
componentReducers => Object.assign(reducers, componentReducers)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment