Fix dashboard not working for 7 days

This commit is contained in:
KMKoushik
2024-05-03 19:41:15 +10:00
parent 4e671556cc
commit f8312fe63d
2 changed files with 5 additions and 1 deletions

1
.gitignore vendored
View File

@@ -36,3 +36,4 @@ yarn-error.log*
# Misc # Misc
.DS_Store .DS_Store
*.pem *.pem
prod_db.tar

View File

@@ -125,7 +125,6 @@ export const emailRouter = createTRPCRouter({
(acc, { latestStatus, createdAt }) => { (acc, { latestStatus, createdAt }) => {
const day = format(createdAt, "MMM dd"); const day = format(createdAt, "MMM dd");
console.log(day);
if ( if (
!day || !day ||
![ ![
@@ -139,6 +138,10 @@ export const emailRouter = createTRPCRouter({
return acc; return acc;
} }
if (!acc[day]) {
return acc;
}
acc[day]![ acc[day]![
latestStatus as latestStatus as
| "DELIVERED" | "DELIVERED"