Revised initial state for monitors
This commit is contained in:
1 parent
ccb61004bb
commit
fbe357091a
2 files changed
+25
-35
No files matched your search
@@ -1,34 +1,20 @@
|
||||
import { createSlice } from "@reduxjs/toolkit";
|
||||
|
||||
const initialState = [
|
||||
{
|
||||
_id: 1,
|
||||
userId: 1,
|
||||
name: "Google",
|
||||
description: "Search engine",
|
||||
url: "https://www.google.com",
|
||||
isActive: true,
|
||||
interval: 1000,
|
||||
createdAt: "2021-01",
|
||||
updatedAt: "2021-01",
|
||||
},
|
||||
{
|
||||
_id: 2,
|
||||
userId: 1,
|
||||
name: "Yahoo",
|
||||
description: "Search engine",
|
||||
url: "https://www.yahoo.com",
|
||||
isActive: true,
|
||||
interval: 1000,
|
||||
createdAt: "2021-01",
|
||||
updatedAt: "2021-01",
|
||||
},
|
||||
];
|
||||
const initialState = {
|
||||
isLoading: false,
|
||||
monitors: [],
|
||||
success: null,
|
||||
msg: null,
|
||||
};
|
||||
|
||||
const monitorsSlice = createSlice({
|
||||
name: "monitors",
|
||||
initialState,
|
||||
reducers: { setMonitors: (state, action) => action.payload },
|
||||
reducers: {
|
||||
setMonitors: (state, action) => {
|
||||
state.monitors = action.payload;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export const { setMonitors } = monitorsSlice.actions;
|
||||
|
||||
Reference in new issue
Block a user