mirror of
https://github.com/umami-software/umami.git
synced 2026-02-18 19:45:35 +01:00
Create new website action and modify redux struct
This commit is contained in:
parent
b756fcddf1
commit
fe861795bc
1 changed files with 7 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue