import { successType } from "fredux";
import { LOAD_CONFIGURATION, UPDATE_CONFIGURATION } from "actions/configuration";

const configuration = (state = {}, { type, payload }) => {
  switch (type) {
    case successType(LOAD_CONFIGURATION):
    case successType(UPDATE_CONFIGURATION):
      return {
        ...payload.response,
      };

    default:
      return state;
  }
};

export const getConfiguration = state => state;

export default configuration;
