Initial commit

Created from https://vercel.com/new
This commit is contained in:
WaylonWalker 2021-12-08 18:25:42 +00:00
commit 4047a7ec23
378 changed files with 29334 additions and 0 deletions

29
redux/actions/websites.js Normal file
View file

@ -0,0 +1,29 @@
import { createSlice } from '@reduxjs/toolkit';
const websites = createSlice({
name: 'websites',
initialState: {},
reducers: {
updateWebsites(state, action) {
state = action.payload;
return state;
},
updateWebsite(state, action) {
const { websiteId, ...data } = action.payload;
state[websiteId] = data;
return state;
},
},
});
export const { updateWebsites, updateWebsite } = websites.actions;
export default websites.reducer;
export function setDateRange(websiteId, dateRange) {
return dispatch => {
return dispatch(
updateWebsite({ websiteId, dateRange: { ...dateRange, modified: Date.now() } }),
);
};
}