Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fix null error activity-logs

Steven Teyf1705097e10f
diff --git a/apps/web/app/api/activity-logs/route.ts b/apps/web/app/api/activity-logs/route.ts
index 38e850c12f..f5745792ef 100644
--- a/apps/web/app/api/activity-logs/route.ts
+++ b/apps/web/app/api/activity-logs/route.ts
@@ -65,7 +65,7 @@ export const GET = withWorkspace(async ({ workspace, searchParams }) => {
group: {
old: null,
new: parsedActivityLogs[parsedActivityLogs.length - 1]?.changeSet
- ?.group.old ?? {
+ ?.group?.old ?? {
id: programEnrollment.groupId,
name: programEnrollment.partnerGroup?.name,
},
diff --git a/apps/web/lib/zod/schemas/activity-log.ts b/apps/web/lib/zod/schemas/activity-log.ts
index 1ed86e9574..ef80f6b66a 100644
--- a/apps/web/lib/zod/schemas/activity-log.ts
+++ b/apps/web/lib/zod/schemas/activity-log.ts
@@ -59,7 +59,7 @@ export const activityLogSchema = z.object({
description: z.string().nullable(),
changeSet: z.record(z.string(), fieldDiffSchema).nullable(),
createdAt: z.date(),
- user: UserSchema.nullable().default(null),
+ user: UserSchema.nullable(),
});
export const REWARD_EVENT_TO_RESOURCE_TYPE = {