export default function deployments (state = defaultDeployments, action) { const {type, payload} = action; switch (type) { case DEPLOYMENTS_LIST_START: return { ...state, error: null, fetching: true }; case DEPLOYMENTS_LIST_SUCCESS: return { ...state, collection: { ...state.collection, ...arrayToCollection(getDeplyomentId, payload) } }; case DEPLOYMENTS_LIST_ERROR: return { ...state, fetching: false, error: payload }; case LAMBDA_DEPLOY_START: return { ...state, error: null, creationRunning: true }; case LAMBDA_DEPLOY_ERROR: return { ...state, creationRunning: false, error: payload }; case LAMBDA_DEPLOY_SUCCESS: return { ...state, creationRunning: false, collection: { ...state.collection, ...arrayToCollection(getDeplyomentId, payload) } }; case LAMBDA_DELETE_SUCCESS: return { ...state, creationRunning: false, collection: {} }; default: return state; } }
export default function environments (state = defaultEnvironments, action) { const {type, payload} = action; switch (type) { case ENVIRONMENTS_LIST_START: return { ...state, fetching: true, fetchingError: null }; case ENVIRONMENTS_LIST_SUCCESS: return { fetching: false, fetchingError: null, collection: { ...state.collection, ...arrayToCollection(getEnvironmentId, payload) } }; case ENVIRONMENTS_LIST_ERROR: return { ...state, fetching: false, fetchingError: payload }; default: return state; } }
export default function lambdas (state = defaultLambdas, action) { const {type, payload} = action; switch (type) { case LAMBDAS_LIST_START: return { ...state, fetching: true, fetchingError: null }; case LAMBDAS_LIST_SUCCESS: return { fetching: false, fetchingError: null, collection: { ...state.collection, ...arrayToCollection(getLambdaId, payload) } }; case LAMBDAS_LIST_ERROR: return { ...state, fetching: false, fetchingError: payload }; default: return state; } }