Create new website action and modify redux struct

pull/882/head
Chris Walsh 2021-12-04 01:54:17 -08:00
parent b756fcddf1
commit fe861795bc
No known key found for this signature in database
GPG Key ID: 28EE0CCA6032019E
1 changed files with 7 additions and 1 deletions

View File

@ -10,7 +10,7 @@ const websites = createSlice({
}, },
updateWebsite(state, action) { updateWebsite(state, action) {
const { websiteId, ...data } = action.payload; const { websiteId, ...data } = action.payload;
state[websiteId] = data; state[websiteId] = { ...state[websiteId], ...data };
return state; return state;
}, },
}, },
@ -27,3 +27,9 @@ export function setDateRange(websiteId, dateRange) {
); );
}; };
} }
export function setWebsiteCreated(websiteId, createdAt) {
return dispatch => {
return dispatch(updateWebsite({ websiteId, createdAt }));
};
}