aboutsummaryrefslogtreecommitdiff
path: root/src/store/maintenances.js
blob: 0f5e41d191ca56e1570df62e4e9c901fc5cae6d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { createSlice } from '@reduxjs/toolkit';

const { reducer, actions } = createSlice({
  name: 'maintenances',
  initialState: {
    items: {},
  },
  reducers: {
    refresh(state, action) {
      state.items = {};
      action.payload.forEach((item) => state.items[item.id] = item);
    },
  },
});

export { actions as maintenancesActions };
export { reducer as maintenancesReducer };