Create new website action and modify redux struct
parent
b756fcddf1
commit
fe861795bc
|
@ -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 }));
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue