import { createSlice } from "@reduxjs/toolkit";

export const theSlice = createSlice({
  name: 'other-settings',
  initialState: {
    data: {},
    loaded: false,
  },
  reducers: {
    // section parts
    loadOtherSettings: (state, action) => {
      const data = action.payload;
      state.data = data;
      state.loaded = true;
    },
    updateOtherSetting: (state, action) => {
      const data = action.payload
      Object.assign(state.data, data);
    }
  }
});

export const {
  loadOtherSettings,
  updateOtherSetting,
} = theSlice.actions;
export default theSlice.reducer;