diff --git a/redux/actions/websites.js b/redux/actions/websites.js index ef6bd872..28bdfe59 100644 --- a/redux/actions/websites.js +++ b/redux/actions/websites.js @@ -10,7 +10,7 @@ const websites = createSlice({ }, updateWebsite(state, action) { const { websiteId, ...data } = action.payload; - state[websiteId] = data; + state[websiteId] = { ...state[websiteId], ...data }; return state; }, }, @@ -27,3 +27,9 @@ export function setDateRange(websiteId, dateRange) { ); }; } + +export function setWebsiteCreated(websiteId, createdAt) { + return dispatch => { + return dispatch(updateWebsite({ websiteId, createdAt })); + }; +}