Refactored funnel report. Made BarChart more generic.

This commit is contained in:
Mike Cao committed 2023-05-24 21:40:02 -07:00
1 parent 050cd2f5d9
commit fb4dd75e18
24 files changed
+327 -367

No files matched your search

+2 -6
View File
@@ -15,8 +15,6 @@ const store = create(() => ({ ...initialState }));
export function updateReport(id, data) {
const report = store.getState()[id];
console.log('UPDATE STORE START', id, report);
if (report) {
store.setState(
produce(state => {
@@ -37,9 +35,9 @@ export function updateReport(id, data) {
}
}
export function createReport() {
export function createReport(parameters) {
const id = `new_${getRandomChars(16)}`;
const report = { ...emptyReport, id };
const report = { ...emptyReport, id, parameters };
store.setState(
produce(state => {
@@ -49,8 +47,6 @@ export function createReport() {
}),
);
console.log('CREATE STORE', report);
return report;
}